Description Usage Arguments Value Note Author(s) Examples
Find a dimension/combination of dimensions with certain conditions.
1 2 | findCombination(table, combs = "NULL", chooseFun = "median",
valueFun = "mad", dimDecreasing = TRUE)
|
table |
A sample of data with dimensions >=2, can be a matrix, an array or a table. |
combs |
A matrix of dimension combinations, each column stores the dimensions of a combination. |
chooseFun |
The summary to represent the variability (spread) of each dimension/combination of dimensions, can be functions in R or self-defined functions. |
valueFun |
The summary to measure the variability (spread) of each layer of the dimension/combination of dimensions, can be functions in R or self-defined functions. |
dimDecreasing |
Logical, if order the dimensions/combinations in a decreasing order. |
The dimension/combination of dimensions which is ordered first.
Here, the default of chooseFun is "median" and the default of valueFun is "mad" since in our tidytable package we define the varaibility of a dimension (combination of dimensions) as the median of mad values get from each layer of that dimension (combination).
R. Wayne Oldford and Xiaomei Yu
1 2 3 4 5 | table <- Titanic
coms <- combn(length(dim(table)), 2) # all the combinations of two dimensions
findCombination(table, coms, chooseFun = "median", valueFun = "mad", dimDecreasing = TRUE)
# so the combination of first two dimensions has the largest variability
# among all combinations of two dimensions in Titanic data
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.