Delete the dimensions of an rvar
which are of size one. See base::drop()
# S4 method for rvar
drop(x)
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 rvar
s, unlike numeric
s,
never have NULL
dimensions).
(rvar) an rvar
.
# 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]
Run the code above in your browser using DataLab