I need to find null values inside a data.frame using sqldf or dplyr libraries.
I know that I can use na.omit() to do that, but I cant find the way to do the same using sqldf or dplyr libraries.
Does anyone know how to do that?
Thank you
I need to find null values inside a data.frame using sqldf or dplyr libraries.
I know that I can use na.omit() to do that, but I cant find the way to do the same using sqldf or dplyr libraries.
Does anyone know how to do that?
Thank you
drop_na
from tidyr will drop all rows that contain missing values in any column (or in columns that you specify).
Here's the example from the documentation:
library(dplyr)
df <- tibble(x = c(1, 2, NA), y = c("a", NA, "b"))
df %>% drop_na()
#> # A tibble: 1 x 2
#> x y
#> <dbl> <chr>
#> 1 1 a
df %>% drop_na(x)
#> # A tibble: 2 x 2
#> x y
#> <dbl> <chr>
#> 1 1 a
#> 2 2 NA