Learn R Programming

cheapr (version 1.2.0)

sset_df: Fast functions for data frame subsetting

Description

These functions are for developers that need minimal overhead when filtering on rows and/or cols.

Usage

sset_df(x, i = NULL, j = NULL, ...)

sset_row(x, i = NULL)

sset_col(x, j = NULL)

Value

A data frame subsetted on rows i and cols j.

Arguments

x

A data.frame.

i

Rows - If NULL all rows are returned.

j

Cols - If NULL all cols are returned.

...

Unused.

Details

If you are unsure which functions to use then it is recommended to use sset(). These low-overhead helpers do not work well with data.tables but should work well with basic data frames and basic tibbles. The only real difference between sset_df and sset_row/sset_col is that sset_df attempts to return a similar type of data frame as the input, whereas sset_row and sset_col always return a plain data frame.