interact.data {ncpen} | R Documentation |
interact.data
interacts all the data in a data.frame
or matrix
.
interact.data(data, base.cols = NULL, exclude.pair = NULL)
data |
a |
base.cols |
indicates columns from one category.
Interactions among variables from a same base.col will be avoided. For example, if three indicator columns,
"ChannelR", "ChannelC" and "ChannelB", are created from a categorical column "Channel", then the interaction among them
can be excluded by assigning |
exclude.pair |
the pairs will be excluded from interactions. This should be a |
This returns an object of matrix
which contains interactions.
df = data.frame(1:3, 4:6, 7:9, 10:12, 13:15); colnames(df) = c("aa", "bb", "cc", "dd", "aa2"); df interact.data(df); interact.data(df, base.cols = "aa"); interact.data(df, base.cols = "aa", exclude.pair = list(c("bb", "cc")));