sample_df: Get random samples from a dataframe, without replacement

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Takes n random sample from the dataframe df without replacement

Usage

1

Arguments

df

Dataframe from which to sample

n

Integer value of number of samples to take

Value

Dataframe with sampled rows

Examples

1
2
3
4
set.seed(1)

test <- data.frame(x = seq(1, 10, 1), y = rnorm(10))
test_sample <- sample_df(test, 5)

AndBooth/Rutils documentation built on May 28, 2019, 11:04 a.m.