Generates an \(n \times 1\) univariate data vector
or a list of \(n \times 1\) univariate data vectors of length R
.
The default data generating function
is the normal distribution
$$
X \sim \mathcal{N} \left( \mu, \sigma^2 \right) .
%(\#eq:dist-X-norm)
$$
univ( n, rFUN = rnorm, ..., R = NULL, par = FALSE, ncores = NULL, mc = TRUE, lb = FALSE, cl_eval = FALSE, cl_export = FALSE, cl_expr, cl_vars, rbind = NULL )
n | Integer. Sample size. |
---|---|
rFUN | Function. Data generating function to generate univariate data. |
... | Arguments to pass to |
R | Integer.
Number of Monte Carlo replications. If |
par | Logical.
If |
ncores | Integer.
Number of cores to use if |
mc | Logical.
If |
lb | Logical.
If |
cl_eval | Logical.
Execute |
cl_export | Logical.
Execute |
cl_expr | Expression.
Expression passed to |
cl_vars | Character vector.
Names of objects to pass to |
rbind | NULL or logical.
If |
If R = NULL
or R = 1
,
returns an \( n \times 1 \) univariate data vector generated
using rFUN
and parameters passed to ...
.
If R
is an integer greater than 1, (e.g., R = 10
)
returns a list of length R
of \( n \times 1 \) univariate data vector
generated using rFUN
and parameters passed to ...
.
The univariate distribution and parameters used
in the data generating process can be specified using rFUN
and ...
.
Options for explicit parallelism are provided when R > 1
especially when R
is large. See par
and suceeding arguments.
#> num [1:100] 98.6 87.6 99.7 104.8 117.6 ...#> List of 100 #> $ : num [1:100] 107.1 85.4 105.4 98.8 86.4 ... #> $ : num [1:100] 96.2 78 83.4 109.2 137.5 ... #> $ : num [1:100] 113.7 90.9 90 112 82.7 ... #> $ : num [1:100] 71.6 86.6 107.6 97 130.7 ... #> $ : num [1:100] 96 110.4 105.6 116.3 99.3 ... #> $ : num [1:100] 102.7 82.6 72.2 90.6 90.2 ... #> [list output truncated]