Learn R Programming

radiant.data (version 1.4.5)

iterms: Create a vector of interaction terms for linear and logistic regression

Description

Create a vector of interaction terms for linear and logistic regression

Usage

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

Value

Character vector of interaction term labels

Arguments

vars

Labels to use

nway

2-way (2) or 3-way (3) interaction labels to create

sep

Separator to use between variable names (e.g., :)

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