Pairwise combinations of variables that will be the result of a function applied to each combination.
comb_vars(.data, order = "first", FUN = "+", verbose = TRUE)
.data | A matrix of data with, say, p columns. |
---|---|
order | The order on how the results will appear in the output. Default
is |
FUN | The function that will be applied to each combination. The default
is |
verbose | Logical argument. If |
A data frame containing all possible combination of variables. Each
combination is the result of the function in FUN
applied to the two
variables.
Tiago Olivoto tiagoolivoto@gmail.com
# \donttest{ library(metan) data <- data.frame(A = rnorm(n = 5, mean = 10, sd = 3), B = rnorm(n = 5, mean = 120, sd = 30), C = rnorm(n = 5, mean = 40, sd = 10), D = rnorm(n = 5, mean = 1100, sd = 200), E = rnorm(n = 5, mean = 2, sd = 1)) comb1 <- comb_vars(data) comb2 <- comb_vars(data, FUN = '*', order = 'second') # }