draws-index: Index 'draws' objects

Description Usage Arguments Details Value Examples

Description

Index variables, iterations, chains, and draws.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17

Arguments

x

(draws) A draws object or another R object for which the method is defined.

...

Arguments passed to individual methods (if applicable).

value

(character vector) For variables(x) <- value, the new variable names to use.

Details

The methods variables(), iteration_ids(), chain_ids(), and draw_ids() return vectors of all variables, iterations, chains, and draws, respectively. In contrast, the methods nvariables(), niterations(), nchains(), and ndraws() return the number of variables, iterations, chains, and draws, respectively.

variables(x) <- value allows you to modify the vector of variable names, similar to how names(x) <- value works for vectors and lists. For renaming specific variables, rename_variables() may offer a more convenient approach.

Value

For variables(), a character vector.

For iteration_ids(), chain_ids(), and draw_ids(), an integer vector.

For niterations(), nchains(), and ndraws(), a scalar integer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14

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