rep_sample_n: Repeating sampling with a given sample size and number of...

Description Usage Arguments Value

View source: R/rep_sample_n.R

Description

Take a sample from the given data frame with a given sample size and a desired number of times. Useful for generating sampling and bootstrap distributions, and works well in a dplyr pipeline. Built with dplyr::sample_n in mind.

Usage

1
rep_sample_n(tbl, size, replace = FALSE, reps = 1)

Arguments

tbl

tbl of data.

size

The number of rows to select.

replace

Sample with or without replacement?

reps

The number of samples to collect.

Value

A tbl_df that aggregates all created samples, with the addition of a replicate column that the tbl_df is also grouped by


andrewpbray/oilabs documentation built on Feb. 7, 2022, 9:22 a.m.