normDataWithin: Normalizing helper function for within-subjects data..

View source: R/normDataWithin.R

normDataWithinR Documentation

Normalizing helper function for within-subjects data..

Description

Norms the data within specified groups in a data frame; it normalizes each.

Usage

normDataWithin(
  data = NULL,
  idvar,
  measurevar,
  betweenvars = NULL,
  na.rm = FALSE,
  .drop = TRUE
)

Arguments

data

A data frame.

idvar

The name of a column that identifies each subject (or matched subjects).

measurevar

The name of a column that contains the variable to be summariezed.

betweenvars

A vector containing names of columns that are between-subjects variables.

na.rm

A boolean that indicates whether to ignore NA's.

Note

See : http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/

Author(s)

Winston Chang

Examples

x <- rnorm(100,100,15)
y <- sample(c("Group 1","Group 2"),100,TRUE)
z <- sample(c("Low","Med","High"),100,TRUE)
subject <- rep(1:5,20)
df <- data.frame(x,y,z,subject)

summarySEwithin(data=df, measurevar="x", betweenvars="y", withinvars="z", idvar="subject")

chavezlab/csnl documentation built on June 12, 2022, 10:09 a.m.