powered by
Convert data from wide to long format
wide2long( data, within_factors = c(), within_cols = c(), dv = "y", id = "id", sep = faux_options("sep") )
a tbl in long format
the tbl in wide format
the names of the within factors
the names (or indices) of the within-subject (value) columns
the name of the dv column (defaults to "y")
the name of the ID column(s) if they don't exist, a new column will be made (defaults to ("id")
separator for within-columns (to be used in strsplit, so can be regex), defaults to "_"
wide2long(iris, c("Feature", "Measure"), 1:4, sep = "\\.")
Run the code above in your browser using DataLab