| sample_without_replacement | R Documentation |
sample_size samples from population_vector without replacement, weighted by sampling_probabilitiesDraw sample_size samples from population_vector without replacement, weighted by sampling_probabilities
sample_without_replacement(
population_vector,
sampling_probabilities,
sample_size
)
population_vector |
Vector from which to draw samples. |
sampling_probabilities |
Vector of probabilities of drawing each element of |
sample_size |
Number of samples to draw from |
Vector of size sample_size
a <- as.integer(c(4,3,2,5,1,9,7))
p <- c(0.7,0.2,0.05,0.02,0.01,0.01,0.01)
num_samples <- 5
sample_without_replacement(a, p, num_samples)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.