widenDSS | R Documentation |
This function transforms the data from long (ex: CDISC) to wide format using the function dcast from the package reshape2.
widenDSS(
what,
measure,
cols = NULL,
formula = NULL,
by.col = NULL,
completeCases = FALSE,
fun.aggregate = NULL
)
what |
a data.frame |
measure |
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 an attempt will be made to guess it with suggest.pivot.formula. |
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? |
a data.frame in wide format
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.