randrows {esmtools} | R Documentation |
Randomly Sample Rows from a Dataframe
Description
The randrows()
function randomly samples a specified number of rows from a dataframe.
Usage
randrows(.data, n = 5)
Arguments
.data |
The dataframe from which rows are to be sampled. |
n |
The number of rows to be randomly sampled. Default is 5. |
Value
A dataframe containing the randomly sampled rows.
Examples
# Randomly sample 3 rows from the dataset
randrows(esmdata_sim, n = 3)
[Package esmtools version 1.0.1 Index]