take: Subset data frames

Description Usage Arguments Value See Also Examples

Description

Return subset of a data frame which meets conditions.

Usage

1
2
3
4
5
6
7
8
9
take(.data, .condition, ...)

take_(.data, .condition, ..., .dots)

## S3 method for class 'data.frame'
take_(.data, .condition, ..., .dots)

## S3 method for class 'tbl_df'
take_(.data, .condition, ..., .dots)

Arguments

.data

A tbl or data.frame.

.condition

A condition defining the filter to be applied on .data.

...

Variable names to be selected.

.dots

character vector of variable names to be selected.

Value

A tbl or data.frame

See Also

filter and select from package dplyr.

Examples

1
2
3
4
df <- mtcars[1:10,]
take(df, cyl %in% c(4, 6), mpg, disp)
take_(df, ~ cyl %in% c(4, 6), ~ mpg, ~ disp)
take_(df, ~ cyl %in% c(4, 6), .dots = c("mpg", "disp"))

paulponcet/lplyr documentation built on May 24, 2019, 10:32 p.m.