as.folder.data.frame {dad} | R 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. If omitted, the last column of |
... |
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)