View source: R/sample_vector.R
sample_vector | R Documentation |
A ggplot2 theme with a white panel background, no grid lines, large axis and legend titles, and increased text padding for better readability.
sample_vector(values, weights, length)
values |
Vector- the thing you want to sample from |
weights |
vector of integers the same length as values- the proportions with which you want to sample |
length |
integer- how long you want the return value to be- e.g. the number of rows in a dataframe |
sample_vector(values = c(NA, "Male", "Female", "Other"),
weights = c(10, 50, 50, 2),
length = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.