metan (version 1.2.1)

as.split_factors: Coerce to an object of class split_factors

Description

Functions to coerce an object to a list of class split_factors, if possible.

Usage

as.split_factors(x, verbose = TRUE)

Arguments

x

The input data.

verbose

Logical argument. If verbose = FALSE the code will run silently.

Value

An object of class split_factors.

Details

A dataframe may be easily coerced to be split into named subsets based on each combination of factors existing in the original dataframe. For example, if the original data has two columns, namely ENV (four levels) and HIB (ten levels), and ten numeric columns, then using as.split_factors will split the data into 40 10-columns subsets, corresponding to each combination of ENV x HIB.

Examples

Run this code
# NOT RUN {
library(metan)
spdata = as.split_factors(iris)

spdata2 = as.split_factors(CO2)

is.split_factors(spdata2)

# }

Run the code above in your browser using DataLab