Learn R Programming

radiant (version 0.1.95)

sampling: Simple random sampling

Description

Simple random sampling

Usage

sampling(dataset, smp_var, smp_sample_size, data_filter = "", smp_print_full = TRUE)

Arguments

dataset
Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant
smp_var
The variable to sample from
smp_sample_size
Number of units to select
data_filter
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")
smp_print_full
Print full sampling frame. Default is TRUE

Value

A list of variables defined in sampling as an object of class sampling

Details

See http://vnijs.github.io/radiant/quant/sampling.html for an example in Radiant

See Also

summary.sampling to summarize results

Examples

Run this code
result <- sampling("rndnames","Names",10)

Run the code above in your browser using DataLab