draws_rvars: The 'draws_rvars' format

Description Usage Arguments Details Value See Also Examples

View source: R/as_draws_rvars.R

Description

The as_draws_rvars() methods convert objects to the draws_rvars format. The draws_rvars() function creates an object of the draws_rvars format based on a set of numeric vectors. See Details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
as_draws_rvars(x, ...)

## Default S3 method:
as_draws_rvars(x, ...)

## S3 method for class 'draws_rvars'
as_draws_rvars(x, ...)

## S3 method for class 'list'
as_draws_rvars(x, ...)

## S3 method for class 'draws_matrix'
as_draws_rvars(x, ...)

## S3 method for class 'draws_array'
as_draws_rvars(x, ...)

## S3 method for class 'draws_df'
as_draws_rvars(x, ...)

## S3 method for class 'draws_list'
as_draws_rvars(x, ...)

## S3 method for class 'mcmc'
as_draws_rvars(x, ...)

## S3 method for class 'mcmc.list'
as_draws_rvars(x, ...)

draws_rvars(..., .nchains = 1)

is_draws_rvars(x)

Arguments

x

An object to convert to a draws_rvars object.

...

For as_draws_rvars(): Arguments passed to individual methods (if applicable). For draws_rvars(): Named arguments containing numeric vectors each defining a separate variable.

.nchains

(positive integer) The number of chains. The default is 1.

Details

Objects of class "draws_rvars" are lists of rvar objects. See Examples.

Value

A draws_rvars object, which has classes c("draws_rvars", "draws", "list").

See Also

Other formats: draws_array(), draws_df(), draws_list(), draws_matrix(), draws

Examples

1
2
3
4
5
6
7
8
9
x1 <- as_draws_rvars(example_draws())
class(x1)
print(x1)
str(x1)

x2 <- draws_rvars(a = rnorm(10), b = rnorm(10), c = 1)
class(x2)
print(x2)
str(x2)

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