to_be: To Be or Not To Be

Description Usage Arguments Value Examples

View source: R/to_be.R

Description

Obtains the subset and the opposite of the subset (anti-subset) of data frames.

Usage

1
to_be(x, f, ...)

Arguments

x

an object to be subsetted

f

a subsetting function (subset, dplyr::slice, dplyr::filter, dplyr::select, etc) that applies to only one dimension of the data frame

...

additional arguments to subsetting function f

Value

list
Element "to_be" contains the subsetted object
Element "not_to_be" contains the opposite of the subsetted object (anti-subset)

Examples

1
2
3
4
5
to_be(mtcars, dplyr::slice, 1:5)
to_be(mtcars, subset, cyl != 4)
to_be(mtcars, dplyr::filter, cyl != 4, mpg > 20)
to_be(mtcars, dplyr::select, -one_of(c("gear", "vs")))
to_be(iris, view_duplicated)

jennguyen1/jn.general documentation built on March 20, 2018, 4:26 a.m.