recast | R Documentation |
melt and cast data in a single step
recast(data, formula, ..., id.var, measure.var)
data |
Data set to melt |
formula |
Casting formula, see cast for specifics |
... |
Other arguments passed to cast |
id.var |
Identifying variables. If blank, will use all non measure.var variables |
measure.var |
Measured variables. If blank, will use all non id.var variables |
This conveniently wraps melting and casting a data frame into one step.
Hadley Wickham <h.wickham@gmail.com>
recast(french_fries, time ~ variable, id.var=1:4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.