sample.data.frame: sample.data.frame

Description Usage Arguments Note

Description

Sample rows from a data.frame

Usage

1
  sample.data.frame(x, size, replace = FALSE, prob = NULL)

Arguments

x

A data.frame

size

A non-negative integer, or a fraction in [0, 1) (see Note)

replace

Should sampling be with replacement?

prob

A vector of probability weights

Note

If size is exactly 1, then one row will be returned. You might instead want sample(x, size = nrow(x), replace = TRUE).


holstius/holstius documentation built on May 17, 2019, 4:50 p.m.