sortIndGroupLabVec: Change group labels according to sorted response size, within...

View source: R/sortPW.R

sortIndGroupLabVecR Documentation

Change group labels according to sorted response size, within a facet.

Description

Change group labels according to sorted response size, within a facet.

Usage

sortIndGroupLabVec(data, groupLabVec, calcStat)

Arguments

data

dataframe. Dataframe with columns 'group' and 'resp', where the elements in 'resp' are the responses of individual subjects, and elements in 'group' specify the subject group.

groupLabVec

named character vector. Specifies labels for each of the unique elements in the 'group' column of data.

Value

A named vector, where the groups are sorted according to response size.

Examples

data = data.frame( group = c( 1, 1, 1, 2, 2, 2, 3, 3, 3 ),
resp = c( 5, 4, 6, 10, 12, 7, 6, 1, 4 ) )
groupLabVec = c( "1" = "A", "2" = "B", "3" = "C" )
sortIndGroupLabVec( data, groupLabVec )

MiguelRodo/ggboot documentation built on Nov. 9, 2023, 5:45 p.m.