randomRows: Sample rows from a dataframe or matrix

Description Usage Arguments Changes Author(s) References See Also

View source: R/randomRows.R

Description

Sample rows from a dataframe or matrix

Usage

1
randomRows(x, size, replace = FALSE, prob = NULL)

Arguments

x

a data frame or matrix

size

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

replace

Should sampling be with replacement?

prob

A vector of probability weights for obtaining the elements of the vector being sampled.

Changes

Matched parameters to sample – njf, May 18, 2015

Author(s)

Spacedman

References

http://stackoverflow.com/questions/8273313/random-rows-in-dataframe-in-r

See Also

sample

sample_n for dplyr users


stackoverflow documentation built on Jan. 10, 2020, 9:07 a.m.