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)} )
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.