Description Usage Arguments Value Note Author(s) Examples
View source: R/asfactormodel.R
Convert factor-like entries in a data structure to factor, with factor as in
factormodel
.
1 | asfactormodel(x, factormodel)
|
x |
A data structure. Currently only integer vectors or lists of vectors are supported. |
factormodel |
A data structure to serve as model for the factor specification. Currently, a factor or a vector of type |
a data structure of same type as x
, with numeric vectors converted to factors.
This functionality could go to R base function factor
.
Should be extended to cover a wide range of data structures, and identify substructures for conversion.
Günther Sawitzki <gsawitzki@users.r-forge.r-project.org>
1 2 3 4 5 6 | data(sprof01lm)
xf <- asfactormodel(sprof01lm$stacks$nodes, sprof01lm$nodes$name)
# To get a character listing, use
sapply(xf, function (x) {as.character(x)} )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.