samplerows: Sample 'n' rows without replacement

View source: R/primitives.R

samplerowsR Documentation

Sample n rows without replacement

Description

Sample n rows without replacement

Usage

samplerows(data, n, by = NULL)

Arguments

data

A data.frame.

n

Integer count.

by

Optional character vector of grouping columns; sample n rows within each group (capped at the group size). Sampled rows are returned in their original order.

Value

A random sample of n rows.


basetable documentation built on Sept. 18, 2026, 9:13 a.m.