Learn R Programming

cheapr (version 1.1.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, keep_attrs = FALSE)

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.

keep_attrs

Should all attributes (except for names and row.names) be kept as is? The default is FALSE which returns a plain data frame.

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.