statPrepareData: prepare data.frame for display in one of the ...multi...

View source: R/generalStat.R

statPrepareDataR Documentation

prepare data.frame for display in one of the ...multi functions, eg statHistMultiple

Description

prepare data.frame for display in one of the ...multi functions, eg statHistMultiple

Usage

statPrepareData(
  data,
  column = 1:ncol(data),
  melted = FALSE,
  varColumn = NA,
  varToChar = FALSE,
  sampleSize = NA,
  removeNA = TRUE,
  meltOrder = NA,
  newNames = NA
)

Arguments

data

the data to be used, can be a numeric/character/etc vector or data.frame like (or tibble etc). If it is data.frame or similar the column argument defines which column is to be used

column

defines which columns are to be used. Can be integer or character (column name), note that if both (character) column and yLabel are defined, column is used as label for the Y-axis. If not defined, then all columns of the data.frame will be used.

melted

boolean that defines whether the specified columns still need to be melted into a single column for a graph. If melted = TRUE then the argument "column" should be a single column!

varColumn

this boolean argument is only used in case melted = TRUE. It specifies the column to be used as variable name column

varToChar

default FALSE, gnored if melted = FALSE. Specifies if the variable name column should be converted into a character vector (need discrete values)

sampleSize

allows to the use of a sample of the data to be used for the boxplot. By default sampleSize = NA, in which case all data is used

removeNA

if TRUE, the NA 'values' in the vector will be removed

meltOrder

numeric vector which allows to define the order in which columns should be melted onto each other. Normally the order is the same as the column order specifoed (default NA), but this parameter allows some extra flexibility. Be aware that columns are first melted and then newNames is applied (if not NA)

newNames

redefines the names of the different data columns. In principle this could be done before this function is called, but using this argument circumvents some issues with column names. Note that the length of this argument (character vector) should be the same as the number of columns, otherwise it will be ignored

Value

a data.frame


BenBruyneel/BBPersonalR documentation built on Aug. 23, 2024, 8:28 p.m.