reserved_variables: Reserved variables

Description Usage Arguments Details Value Examples

View source: R/reserved_variables.R

Description

Get names of reserved variables from objects in the posterior package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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 draws object or another R object for which the method is defined.

...

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:

Further, specific for the draws_df format, there are three additional reserved variables:

More reserved variables may be added in the future.

Value

A character vector of reserved variables used in x.

Examples

1
2
3
4
5
6
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)

posterior documentation built on Sept. 9, 2021, 5:07 p.m.