Learn R Programming

radiant.design (version 1.3.5)

sampling: Simple random sampling

Description

Simple random sampling

Usage

sampling(
  dataset,
  vars,
  sample_size,
  seed = 1234,
  data_filter = "",
  na.rm = FALSE,
  envir = parent.frame()
)

Arguments

dataset

Dataset to sample from

vars

The variables to sample

sample_size

Number of units to select

seed

Random seed to use as the starting point

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")

na.rm

Remove rows with missing values (FALSE or TRUE)

envir

Environment to extract data from

Value

A list of class 'sampling' with all variables defined in the sampling function

Details

See https://radiant-rstats.github.io/docs/design/sampling.html for an example in Radiant

See Also

summary.sampling to summarize results

Examples

Run this code
# NOT RUN {
sampling(rndnames, "Names", 10)

# }

Run the code above in your browser using DataLab