-1

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

Aragorn64
  • 149
  • 7

1 Answers1

0

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  
RyanFrost
  • 1,400
  • 7
  • 17