Learn R Programming

long2lstmarray (version 0.2.0)

get_var_sequence: Get variable values from subject/variable name pair

Description

Get variable values from subject/variable name pair

Usage

get_var_sequence(data, subj_var, subj, var)

Value

A vector of values from variable var

which subj_var equal to subj.

Arguments

data

A data frame, data frame extension (e.g. a tibble).

subj_var

A character string referring to the variable that specifies the "subject" variable.

subj

Any value that the "subject" variable can take.

var

A character string referring to the variable that contains the variable values.

Examples

Run this code
get_var_sequence(sleep, subj_var = "ID", 1, "extra")

Run the code above in your browser using DataLab