Bracket slice and assignment methods adapted for random vectors and arrays.
The assignment function impute<-
is compatible with both non-rv and
rv objects (rv, rvsummary, and rvfactor objects). To write universal code
that works both atomic and rv objects, use impute(x, ...) <- value
instead of x[...] <- value
.
NOTE. x
will NOT be automatically coerced into an rv object.
value
may be an rv object or a regular numeric object.
Extracting rv objects works the same way as extracting components of a
numerical vector or array. The return value is always an object of class
'rv'. Type ?Extract for details.
Note: the index arguments (i
, j
, etc.) must be
constants, but this may change in the future.
%Note: the index arguments (i
, j
, etc.) may be %themselves
random variables, however they will be coerced %into integers, as one
would expect.