reserved_variables {posterior} | R Documentation |
Reserved variables
Description
Get names of reserved variables from objects in the posterior package.
Usage
reserved_variables(x, ...)
## Default S3 method:
reserved_variables(x, ...)
## S3 method for class 'draws_matrix'
reserved_variables(x, ...)
## S3 method for class 'draws_array'
reserved_variables(x, ...)
## S3 method for class 'draws_df'
reserved_variables(x, ...)
## S3 method for class 'draws_list'
reserved_variables(x, ...)
## S3 method for class 'draws_rvars'
reserved_variables(x, ...)
Arguments
x |
(draws) A |
... |
Arguments passed to individual methods (if applicable). |
Details
reserved_variables()
returns the names of reserved variables in use by
an object.
The following variables names are currently reserved for special use cases
in all draws
formats:
-
.log_weight
: Log weights per draw (seeweight_draws
).
Further, specific for the draws_df
format, there are three additional
reserved variables:
-
.chain
: Chain index per draw -
.iteration
: Iteration index within each chain -
.draw
: Draw index across chains
More reserved variables may be added in the future.
Value
A character vector of reserved variables used in x
.
Examples
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)
[Package posterior version 1.6.0 Index]