reshapeasy is a wrapper around base R's reshape which allows for saner syntax. In particular, it makes it possible to reverse the operation by only specifying that the direction change (e.g. the names of the arguments are consistent between the direction of reshaping).
reshapeasy(data, direction,
id = (sapply(data, is.factor) | sapply(data, is.character)),
vary = sapply(data, is.numeric), omit = c("_", "."),
vars = NULL, ...)
A data.frame to be reshaped
"wide" or "long"
he names of the (stubs of) the variables to be reshaped (if omitted, defaults to everything not in id or vary)
The names of the variables that identify unique observations
he variable that varies. Going to wide this variable will cease to exist. Going to long it will be created.
vector of characters which are to be omitted if found at the end of variable names (e.g. price_1 becomes price in long)
Options to be passed to stats::reshape
A data.frame