View source: R/plots-utility-formatToHierarchicalData.R
formatToHierarchicalData | R Documentation |
Note that new variables are created for each variable of interest (the variables are not overwritten) to avoid issues with cases where the value in the child and parent variables are the same.
formatToHierarchicalData(data, vars, valueVar)
data |
Data.frame with data. |
vars |
Character vector with variables of |
valueVar |
String with numeric variable of |
Updated data.frame with vars
in
hierarchical format, with extra attributes (in 'metadat'):
'varID': String with column of output
containing ID of specific element.
This is a combination from the specified vars
,
or 'Overall' for the grand total.
'varParent': String with column of output containing ID of the parent element
'varLabel': String with column of output
containing the label to display.
This is usually the name of the child element.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.