dssPivot | R Documentation |
This function transforms long format data to wide format using the function dcast from the package reshape2.
dssPivot(
symbol,
what,
value.var,
cols = NULL,
formula = NULL,
by.col = NULL,
completeCases = FALSE,
fun.aggregate = NULL,
datasources = NULL,
async = FALSE
)
symbol |
a character name of the new dataframe in wide format |
what |
a character name of data frame in CDISC format |
value.var |
name of the column which stores values, this goes straight into the parameter value.var in reshape2::dcast |
cols |
a vector of columns used in the formula. They must exist in 'what'. If null, all the columns from 'what' will be used. |
formula |
the formula to use by reshape2::dcast. If left null a weak attempt will be made at automatically guessing it. |
by.col |
typically the patient id, the column that will end up as key of the resulting 'wide' data.frame. In most cases this can be left null as it's been set when the package was loaded |
completeCases |
a logical, keep only complete cases? |
fun.aggregate |
a function, see fun.aggregate in reshape2::dcast. Note: if the widening needs an aggregate function and none is provided, ds2.pivot will fail (unlike reshape2::dcast) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.