sample_safe: Random Samples and Permutations (safer)

Description Usage Arguments Details

View source: R/ref_quest_split.R

Description

sample_safe takes a sample of the specified size from the elements of x using either with or without replacement.

Usage

1

Arguments

x

a vector of one or more elements from which to choose

size

a non-negative integer giving the number of items to choose.

replace

should sampling be with replacement?

Details

Works like base::sample(), but it is safer if x is a scalar.


lgaborini/rsamplestudy documentation built on March 6, 2021, 3:18 p.m.