View source: R/as.data.frame.folder.R
as.data.frame.folder | R Documentation |
Builds a data frame from an object of class folder
.
## S3 method for class 'folder'
as.data.frame(x, row.names = NULL, optional = FALSE, ..., group.name = "group")
x |
object of class |
row.names, optional |
for consistency with |
... |
further arguments passed to or from other methods. |
group.name |
the name of the grouping variable. It is the name of the last column of the returned data frame. |
The data frame is simply obtained by row binding the data frames of the folder and adding a factor (as last column). The name of this column is given by group.name
argument. The levels of this factor are the names of the elements of the folder.
as.data.frame.folder
returns a data frame.
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard
folder
: object of class folder
.
as.folder.data.frame
: build an object of class folder
from a data frame.
data(iris)
iris.fold <- as.folder(iris, "Species")
print(iris.fold)
iris.df <- as.data.frame(iris.fold)
print(iris.df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.