head.dtplyr_step: Subset first or last rows

View source: R/step-call.R

head.dtplyr_stepR Documentation

Subset first or last rows

Description

These are methods for the base generics head() and tail(). They are not translated.

Usage

## S3 method for class 'dtplyr_step'
head(x, n = 6L, ...)

## S3 method for class 'dtplyr_step'
tail(x, n = 6L, ...)

Arguments

x

A lazy_dt()

n

Number of rows to select. Can use a negative number to instead drop rows from the other end.

...

Passed on to head()/tail().

Examples

library(dplyr, warn.conflicts = FALSE)
dt <- lazy_dt(data.frame(x = 1:10))

# first three rows
head(dt, 3)
# last three rows
tail(dt, 3)

# drop first three rows
tail(dt, -3)

dtplyr documentation built on March 31, 2023, 9:13 p.m.