split.rv {rv} | R Documentation |
Split a random vector into a list by name.
split.rv(x, f, drop=FALSE, ...)
x |
a random vector |
f |
a ``factor" that specifies the grouping, by default the variable names derived from names{x} . |
drop |
logical indicating if levels that do not occur should be dropped (if f is a factor or a list). |
... |
further potential arguments passed to methods. |
If f
is omitted, splitting is done by names(x)
, but
with the possible brackets (as in ``alpha[10]
") omitted.
Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman
Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.
x <- rvnorm(3) names(x) <- c("alpha[1]", "alpha[2]", "theta") split(x)