sortGroupLabVec: Change group labels according to sorted response size.

View source: R/sortPW.R

sortGroupLabVecR Documentation

Change group labels according to sorted response size.

Description

Change group labels according to sorted response size.

Usage

sortGroupLabVec(data, groupLabVec, calcStat)

Arguments

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 data.

Value

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 )


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