Table of Contents

R - Sample

About

Sample is a function that return a random subset of a data set.

Example

set.seed(1)
# random subset of the original data so that N=15
sample = data[sample(nrow(data), 15), ]

where: