This function takes a data frame as input and returns all possible interaction terms, sums, differences or sums after taking the absolute value of every observation. Normalization before the calculations are carried out is possible. The function does only return the newly created terms, not the input data.
1 | createInteractions(x, type = NULL, normalize = T, excludeFactors = T)
|
x |
A data frame with column names |
type |
"*" for all possible products, "-" for all possible differences, "+" for all possible sums and "absSum" for all possible sums after taking the absolute value of the observations. |
normalize |
If TRUE, normalize all columns before carrying out any calculations. TRUE by default. |
excludeFactors |
If TRUE, excludes all factor variables from the calculations. Otherwise, a high number of variables may be created if the data includes a lot of levels. TRUE by default. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.