wrap.generate: Generate columns

Description Usage Arguments Examples

View source: R/wrap.generate.R

Description

Searches the data frame for pairs of columns whose names are identical except for specific strings that you've embedded within them–such as "T1" versus "T2" or "Participant1" versus "Participant2–and then generates new columns by computing sums, differences, or means between pairs of corresponding columns.

Usage

1
wrap.generate(df, string1, string2, operation)

Arguments

df

The data frame

string1, string2

Strings embedded within the names of corresponding columns

operation

String to specify the operation: must be "sum", "difference", or "mean"

Examples

1
2
## Computing differences between T1 responses and T2 responses
wrap.generate(df = bdata, string1 = "T1", string2 = "T2", operation = "difference")

michaelkardas/behavioralwrappers documentation built on Jan. 2, 2020, 7:46 a.m.