sortGroupLabVec | R Documentation |
Change group labels according to sorted response size.
sortGroupLabVec(data, groupLabVec, calcStat)
data |
dataframe. Dataframe with columns 'facet', 'group', 'resp'. The elements in 'resp' are the responses of individual subjects, elements in 'group' specify the subject group, and elements in 'facet' specify the overall grouping variable. |
groupLabVec |
named character vector. Specifies labels for each of the unique elements in the 'group' column of
|
A named vector, where the groups are sorted according to response size. data = data.frame( group = c( 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3 ), resp = c( 5, 4, 6, 10, 12, 7, 6, 1, 4, 4, 8, 7 ), facet = c( rep( "0", 9 ), rep( "1", 3 ) ) ) groupLabVec = c( "1" = "A", "2" = "B", "3" = "C" ) sortGroupLabVec( data, groupLabVec )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.