Learn R Programming

teal.modules.clinical (version 0.10.0)

split_interactions: Split interaction terms into their component variables

Description

Split interaction terms into their component variables

Usage

split_interactions(x, by = "\\*|:")

Value

a vector of strings where each element is a component variable extracted from interaction term x.

Arguments

x

(character)
string representing the interaction usually in the form x:y or x*y.

by

(character)
regex with which to split the interaction term by.

Examples

Run this code
split_interactions("x:y")
split_interactions("x*y")

Run the code above in your browser using DataLab