findCombination: Find a dimension/combination of dimensions with certain...

Description Usage Arguments Value Note Author(s) Examples

Description

Find a dimension/combination of dimensions with certain conditions.

Usage

1
2
findCombination(table, combs = "NULL", chooseFun = "median",
  valueFun = "mad", dimDecreasing = TRUE)

Arguments

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.

Value

The dimension/combination of dimensions which is ordered first.

Note

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).

Author(s)

R. Wayne Oldford and Xiaomei Yu

Examples

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

rwoldford/tidy-table documentation built on May 12, 2019, 4:38 a.m.