Top "Reshape2" questions

The reshape2 package in R contains functions that allow data to be transformed into more convenient forms.

melt multiple groups of measure.vars

I have a data.table containing a number of variables across multiple years, i.e: > dt <- data.…

r data.table reshape reshape2
Using melt with matrix or data.frame gives different output

Consider the following code: set.seed(1) M = matrix(rnorm(9), ncol = 3) dimnames(M) = list(LETTERS[1:3], LETTERS[1:3]) print(M) A B C …

r matrix dataframe reshape2 melt
in R, customize names of columns created by dcast.data.table

I am new to reshape2 and data.table and trying to learn the syntax. I have a data.table that …

r data.table pivot-table reshape2