Learn R Programming

datacheckr (version 0.2.0.9002)

check_rows: Check Rows

Description

Checks the number of rows in data.

Usage

check_rows(data, min_row = 1, max_row = max_nrow(),
  data_name = substitute(data))

Arguments

data
The data frame to check.
min_row
A count of the minimum number of rows.
max_row
A count of the maximum number of rows.
data_name
A string of the name of data.

Value

Throws an informative error or returns an invisible copy of data.

Details

By default (min_row = 1) data must include at least one row.

Examples

Run this code
try(check_rows(data.frame()))
try(check_rows(data.frame(x = 1), 2))

Run the code above in your browser using DataLab