View source: R/simulateEmpiricalDistribution.R
simulateEmpiricalDistribution | R Documentation |
Function to sample Empirical Distributions without replacement, as
opposed to the rand
method which samples with replacement.
simulateEmpiricalDistribution(EmpiricalDist, n, seed = NULL)
EmpiricalDist |
Empirical Distribution |
n |
Number of samples to generate. See Details. |
seed |
Numeric passed to |
This function can only be used to sample from the Empirical
distribution without
replacement, and will return an error for other distributions.
The seed
param ensures that the same samples can be reproduced and is more convenient than
using the set.seed()
function each time before use. If set.seed
is NULL
then the
seed is left unchanged (NULL is not passed to the set.seed
function).
If n
is of length greater than one, then n
is taken to be the length of n
.
If n
is greater than the number of observations in the Empirical distribution, then
n
is taken to be the number of observations in the distribution.
A vector of length n
with elements drawn without replacement from the given
Empirical distribution.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.