helpers: Helpers Functions And Attributes

Description Usage Arguments Details Value Examples

Description

Helper functions for the rvtable class.

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
33

Arguments

x

rvtable.

id

character, rvtable attribute(s). If not provided, all available rvtable attributes.

all

logical, ignore 'id' and return all attributes, including those not specific to the 'rvtable' class. Defaults to FALSE.

density.args

set rvtable density arguments. See details.

sample.args

set rvtable sampling arguments. See details.

Details

These helper functions provide information about rvtable class objects and their attributes. They get and in some cases set rvtable attributes as well as perform various logical checks. rvattr returns a named list of attributes of x. is* functions return TRUE or FALSE. rvtype, tabletype, valcol and probcol return individual attributes of x (character).

get* functions for density and sample argument lists return the lists from the attributes of x and the corresponding set* functions return x with the new denisty.args and sample.args attributes. Setting density or sample argument lists is usually done when passing arguments to a function, e.g., rvtable or sample_rvtable. However, it can sometimes be useful to set these directly or update them at a desired step in a rvtable processing pipeline. Note that when defaults are not explicitly provided (i.e., leaving as list() or NULL), the atrributes of an rvtable will still display all sampling default arguments and the most important density default arguments for clarity.

Value

information about various rvtable attributes. See details.

Examples

 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
## Not run: 
x <- rvtable(1:10)

is_rvtable(x)
is_sample(x)
is_distribution(x)
is_discrete(x)
is_continuous(x)
is_density(x)

rvattr(x)
rvattr(x, id=c("rvtype", "tabletype"))
rvattr(x, all = TRUE)

rvtype(x)
tabletype(x)
valcol(x)
probcol(x)

get_density_args(x)
get_sample_args(x)
x <- set_density_args(x, list(n = 1000, adjust = 0.1))
x <- set_sample_args(x, list(n = 100))
get_density_args(x)
get_sample_args(x)

## End(Not run)

leonawicz/rvtable documentation built on May 21, 2019, 5:09 a.m.