suggestPivotFormula | R Documentation |
The CDISC format can be cumbersome for analysis. The solution would be to transform the data to wide format using the function dcast from the package reshape2. However, as the actual data is not visible, choosing the right widening formula is challenging. This function applies some simple heuristics on the provided parameters and tries to guess a possible formula. This will not be necessarily the best option (and often it will fail completely) - it can still provide a starting point for further refining.
suggestPivotFormula(what, cols = NULL, by.col = NULL)
what |
a data.frame |
cols |
a vector of columns used in the formula. They must exist in 'what' (the previous argument). If null, all the columns from 'what' will be used. |
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 |
a formula (char) that can be (modified and) passed further to the function 'widen'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.