filter | R Documentation |
Use filter()
to choose rows/cases where conditions are TRUE
.
filter(.data, ..., .preserve = FALSE)
.data |
A |
... |
Logical predicated defined in terms of the variables in |
.preserve |
|
A data.frame
.
==
, >
, >=
, etc.
&
, |
, !
, xor()
is.na()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.