GroupedSampleFracAtLeastOneSample: Fraction Sampling without empty output

Description Usage Arguments Details Value

Description

Sample a random proportion of the data, keeping at least one observation

Usage

1
GroupedSampleFracAtLeastOneSample(d_subset, prop, is.random = TRUE)

Arguments

d_subset

A dtta.frame from which a small sample is to be returned

prop

A number between 0 and 1, being the desired sampling fraction.

is.random

a boolean. If TRUE, a random sample is drawn, else it takes the head() of the data

Details

This function is designed to allow its use with group splitting or do.by methods.

Value

A random sample from the data, of proportion prop, but always returning at least one observation even if prop is too low.


GuessCompx documentation built on June 3, 2019, 5:04 p.m.