generate_similar_vars: Create a vector of similar variable names

Description Usage Arguments Value Examples

View source: R/generate_similar_vars.R

Description

Create a vector of similar variable names

Usage

1
generate_similar_vars(base_exp, affix, prefix = NULL, suffix = NULL)

Arguments

base_exp

String. Common phrase among variables

affix

Vector. Unique phrase to attach to base_exp

prefix

Boolean. Append attachment to the head of base_exp

suffix

Boolean. Append attachment to the tail of base_exp

Value

A vector of similar variable names. All variables names contain the affix.

Examples

1
2
3
generate_similar_vars(base_exp = "m1_blood", affix = 1:10, suffix = TRUE)
generate_similar_vars(base_exp = "m1_blood", affix = c("weight", "height"), prefix = TRUE)
generate_similar_vars(base_exp = c("t0_month", "t1_month"), affix = 1:12, suffix = TRUE)

antchau/glider documentation built on Dec. 1, 2020, 9:23 p.m.