filter: Return rows with matching conditions.

Description Usage Arguments Value See Also Examples

View source: R/manip.r

Description

Return rows with matching conditions.

Usage

1
2
3
filter(.data, ...)

filter_(.data, ..., .dots)

Arguments

.data

A tbl. All main verbs are S3 generics and provide methods for tbl_df, tbl_dt and tbl_sql.

...

Logical predicates. Multiple conditions are combined with &.

.dots

Used to work around non-standard evaluation. See vignette("nse") for details.

Value

An object of the same class as .data.

Data frame row names are silently dropped. To preserve, convert to an explicit variable.

See Also

Other single.table.verbs: arrange, mutate, select, slice, summarise

Examples

1
2
3
4
5
6
7
8
9
filter(mtcars, cyl == 8)
filter(mtcars, cyl < 6)

# Multiple criteria
filter(mtcars, cyl < 6 & vs == 1)
filter(mtcars, cyl < 6 | vs == 1)

# Multiple arguments are equivalent to and
filter(mtcars, cyl < 6, vs == 1)

sctyner/dplyr050 documentation built on May 17, 2019, 2:22 p.m.