| drop,rvar-method | R Documentation |
Delete the dimensions of an rvar which are of size one. See base::drop()
## S4 method for signature 'rvar'
drop(x)
x |
(rvar) an |
An rvar with the same length as x, but where any entry equal to 1
in dim(x) has been removed. The exception is if dim(x) == 1, in which
case dim(drop(x)) == 1 as well (this is because rvars, unlike numerics,
never have NULL dimensions).
# Sigma is a 3x3 covariance matrix
Sigma <- as_draws_rvars(example_draws("multi_normal"))$Sigma
Sigma
Sigma[1, ]
drop(Sigma[1, ])
# equivalently ...
Sigma[1, drop = TRUE]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.