Learn R Programming

esmtools (version 1.0.1)

randrows: 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)

Value

A dataframe containing the randomly sampled rows.

Arguments

.data

The dataframe from which rows are to be sampled.

n

The number of rows to be randomly sampled. Default is 5.

Examples

Run this code
# Randomly sample 3 rows from the dataset
randrows(esmdata_sim, n = 3)

Run the code above in your browser using DataLab