| fac.nested | R Documentation |
Creates a nested factor whose levels are generated
within those of the factor nesting.fac. All elements of nesting.fac
having the same level are numbered from 1 to the number of different elements
having that level.
fac.nested(nesting.fac, nested.levs=NA, nested.labs=NA, ...)
nesting.fac |
The |
nested.levs |
Optional |
nested.labs |
Optional |
... |
Further arguments passed to the |
A factor that is a character vector with class attribute
"factor" and a levels attribute which
determines what character strings may be included in the vector. It has
a different level for of the values of the nesting.fac with the same level.
The levels of nesting.fac do not have to be equally replicated.
Chris Brien
fac.gen, fac.multinested in package dae, factor.
## set up factor A
A <- factor(c(1, 1, 1, 2, 2))
## create nested factor
B <- fac.nested(A)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.