drop_na | R Documentation |
drop_na()
drops rows where any column specified by ...
contains a
missing value.
drop_na(data, ...)
data |
A data frame. |
... |
< |
Another way to interpret drop_na()
is that it only keeps the "complete"
rows (where no rows contain missing values). Internally, this completeness is
computed through vctrs::vec_detect_complete()
.
df <- tibble(x = c(1, 2, NA), y = c("a", NA, "b"))
df %>% drop_na()
df %>% drop_na(x)
vars <- "y"
df %>% drop_na(x, any_of(vars))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.