Skip to contents

This function will be called after an instance is built. User input will be stored in the environment.

Arguments

dist

Character. Distribution name.

prm

List. List of parameters.

Value

Return the object itself.

Examples


RAND_VAR$..init..
#> function (dist = "uniform", prm = list()) 
#> {
#>     self$dist <- dist
#>     if (!is.list(prm)) 
#>         stop("`prm` is not a list!")
#>     self$prm <- prm
#>     return(invisible(self))
#> }
#> <environment: 0x10c099190>

# Instantiate
test <- rand_var(dist = "uniform", prm = list(a = 1, b = 2))
test$prm
#> $a
#> [1] 1
#> 
#> $b
#> [1] 2
#> 
test$dist
#> [1] "uniform"