sample-methods: Take a Sample from a Data Frame-like Object
Description
The methods below are convenience short-cuts to
take samples from data frames and data sets.
They result in a data frame or data set, respectively,
the rows of which are a sample of the complete
data frame/data set.
Usage
## S3 method for class 'data.frame':
sample(x, size, replace = FALSE, prob = NULL)
## S3 method for class 'data.set':
sample(x, size, replace = FALSE, prob = NULL)
## S3 method for class 'importer':
sample(x, size, replace = FALSE, prob = NULL)
Arguments
x
a data frame or data set.
size
an (optional) numerical value, the sample size,
defaults to the total number of rows of x.
replace
a logical value, determines whether
sampling takes place with or without replacement.