Generates Random Numbers based on a distribution defined by any arbitrary cumulative distribution function
r_cdf( Fun, min = -Inf, max = Inf, ..., data = NULL, n = default_n(..., data), .seed = NULL )
Fun | function to use as the cdf. See details |
---|---|
min, max | range values for the domain of the |
... | arguments that can be passed to |
data | data set containing arguments to be passed to |
n | number of observations to generate. The |
.seed | One of the following:
To extract the random seed from a previously generated set of
values, use |
A numeric vector of length n
The Fun
argument accepts purrr
style inputs.
Must be vectorised, defined on the whole Real line and return a
single numeric value between 0 and 1 for any input. The random
variable will be passed to Fun
as the first argument.
This means that R's argument matching can be used with named
arguments in ...
if a different positional argument is wanted.
#> [1] 1.2980998 1.0152400 0.5048573 3.2060206 0.3547609#> [1] 0.05150437 0.85846782 0.24577975 0.13450980 2.78308988#> [1] 1.61582828 0.70951581 0.25349259 0.19785762 0.02016425 0.08192658 #> [7] 0.02701879 0.14669299 0.12494922 0.29242635