Learn R Programming

radiant.data (version 0.6.0)

iterms: Create a vector of interaction terms

Description

Create a vector of interaction terms

Usage

iterms(vars, nway, sep = ":")

Arguments

vars
Variables lables to use
nway
2-way (2) or 3-way (3) interactions labels to create
sep
Separator between variable names (default is :)

Value

Character vector of interaction term labels

Examples

Run this code
paste0("var", 1:3) %>% iterms(2)
paste0("var", 1:3) %>% iterms(3)
paste0("var", 1:3) %>% iterms(2, sep = ".")

Run the code above in your browser using DataLab