as.folder.data.frame: Data frame to folder

View source: R/as.folder.data.frame.R

as.folder.data.frameR Documentation

Data frame to folder

Description

Builds an object of class folder from a data frame.

Usage

## S3 method for class 'data.frame'
as.folder(x, groups = tail(colnames(x), 1), ...)

Arguments

x

data frame.

groups

string. The name of the column of x containing the grouping variable. x[, groups] must be a factor, otherwise, there is an error.

If omitted, the last column of x is used as grouping variable.

...

further arguments passed to or from other methods.

Value

as.folder.data.frame returns an object of class folder that is a list of data frames with the same column names.

Each element of the folder contains the data corresponding to one level of x[, groups].

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

See Also

folder: objects of class folder. as.data.frame.folder: build a data frame from an object of class folder. as.folder.folderh: build an object of class folder from an object of class folderh.

Examples

# First example: iris (Fisher)               
data(iris)
iris.fold <- as.folder(iris, "Species")
print(iris.fold)

# Second example: roses
data(roses)
roses.fold <- as.folder(roses, "rose")
print(roses.fold)

dad documentation built on Aug. 30, 2023, 5:06 p.m.