filter {poorman} | R Documentation |
Return rows with matching conditions
Description
Use filter()
to choose rows/cases where conditions are TRUE
.
Usage
filter(.data, ..., .preserve = FALSE)
Arguments
.data |
A |
... |
Logical predicated defined in terms of the variables in |
.preserve |
|
Value
A data.frame
.
Useful filter functions
-
==
,>
,>=
, etc. -
&
,|
,!
,xor()
-
is.na()
Examples
filter(mtcars, am == 1)
mtcars %>% filter(cyl == 4)
mtcars %>% filter(cyl <= 5 & am > 0)
mtcars %>% filter(cyl == 4 | cyl == 8)
mtcars %>% filter(!(cyl %in% c(4, 6)), am != 0)
[Package poorman version 0.2.7 Index]