findXTbl: Set a categorical variable as x-variable, with all remaining...

View source: R/sortPW.R

findXTblR Documentation

Set a categorical variable as x-variable, with all remaining y-variables.

Description

Returns the rows of plotTbl with the selected group as the x-variable, and all the y-variables that are "smaller" than this variable, as defined by sortVec.

Usage

findXTbl(i, sortVec, plotTbl)

Arguments

i

numeric. sortVec[1:(length(sortVec)-i)] are searched for as y-variables, and rev( sortVec )[i] is set as the x-variable.

sortVec

character vector. Order in which groups are to display along x- and y-axes. The first group along the x-axis is the last element of sortVec.

plotTbl

dataframe. Dataframe with columns x, y and origStat. May have other columns. The combination xVar and yVar must only occur once in plotTbl, regardless of order.

Value

Dataframe with the columns along x and y-axes changed appropriately, for the specific variables as set by i and sortVec.

Examples

findXTbl( 1, 1:2, data.frame(x = c( 3, 1, 1 ),
y = c( 2, 2, 1 ),
origStat = c( 0.5, 0.3, -0.2 ) ) )

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