powered by
Simple random sampling
sampling( dataset, vars, sample_size, seed = 1234, data_filter = "", arr = "", rows = NULL, na.rm = FALSE, envir = parent.frame() )
A list of class 'sampling' with all variables defined in the sampling function
Dataset to sample from
The variables to sample
Number of units to select
Random seed to use as the starting point
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")
Expression to arrange (sort) the data on (e.g., "color, desc(price)")
Rows to select from the specified dataset
Remove rows with missing values (FALSE or TRUE)
Environment to extract data from
See https://radiant-rstats.github.io/docs/design/sampling.html for an example in Radiant
summary.sampling to summarize results
summary.sampling
sampling(rndnames, "Names", 10)
Run the code above in your browser using DataLab