powered by
Get names of reserved variables from objects in the posterior package.
reserved_variables(x, ...)# S3 method for default reserved_variables(x, ...)# S3 method for draws_matrix reserved_variables(x, ...)# S3 method for draws_array reserved_variables(x, ...)# S3 method for draws_df reserved_variables(x, ...)# S3 method for draws_list reserved_variables(x, ...)# S3 method for draws_rvars reserved_variables(x, ...)
# S3 method for default reserved_variables(x, ...)
# S3 method for draws_matrix reserved_variables(x, ...)
# S3 method for draws_array reserved_variables(x, ...)
# S3 method for draws_df reserved_variables(x, ...)
# S3 method for draws_list reserved_variables(x, ...)
# S3 method for draws_rvars reserved_variables(x, ...)
A character vector of reserved variables used in x.
x
(draws) A draws object or another R object for which the method is defined.
draws
Arguments passed to individual methods (if applicable).
reserved_variables() returns the names of reserved variables in use by an object.
reserved_variables()
The following variables names are currently reserved for special use cases in all draws formats:
.log_weight: Log weights per draw (see weight_draws).
.log_weight
weight_draws
Further, specific for the draws_df format, there are three additional reserved variables:
draws_df
.chain: Chain index per draw
.chain
.iteration: Iteration index within each chain
.iteration
.draw: Draw index across chains
.draw
More reserved variables may be added in the future.
x <- example_draws() reserved_variables(x) # if we add weights, the `.log_weight` reserved variable is used x <- weight_draws(x, rexp(ndraws(x))) reserved_variables(x)
Run the code above in your browser using DataLab