filter {dplyr} | R Documentation |
Return rows with matching conditions.
filter(.data, ...) filter_(.data, ..., .dots)
.data |
A tbl. All main verbs are S3 generics and provide methods
for |
... |
Logical predicates. Multiple conditions are combined with |
.dots |
Used to work around non-standard evaluation. See
|
An object of the same class as .data
.
Data frame row names are silently dropped. To preserve, convert to an explicit variable.
Other single.table.verbs: arrange
,
arrange_
; mutate
,
mutate_
, transmute
,
transmute_
; rename
,
rename_
, select
,
select_
; slice
,
slice_
; summarise
,
summarise_
, summarize
,
summarize_
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)