gather_multiple: Gather multiple variables at the same time and turn them into...

Description Usage Arguments Value Examples

View source: R/padis_general_functions.R

Description

Gather multiple variables at the same time and turn them into long format

Usage

1
gather_multiple(data, key_vars, varying = NULL, search = "\\d$")

Arguments

data

The data frame that contains the variables

key_vars

The key or id variables that should be the grouping variables in the long format

varying

The variables that are varying and should be returned in a long format. If NULL, all other variables except key_vars are taken and turned into long format. Default is to search for numbers at the end ("\d$"

search

The search string that is used to detect item-stems

Value

A data frame in long format, with the key_vars as grouping variables and the varying item-stems as stacked variables.

Examples

1
gather_multiple(wide_example_data, key_vars = c("id", "id2"), varying = NULL)

kthorstmann/padis documentation built on May 24, 2019, 5:01 a.m.