It looks like tidyr's drop_na
will drop rows if any of the specified columns contain missing values.
Example:
> library(tidyverse)
> df <- data.frame(a=c(1,NA,2,NA), b=c(3,4,NA,NA))
> df
a b
1 1 3
2 NA 4
3 2 NA
4 NA NA
> df %>% drop_na()
a b
1 1 3
Is there a straightforward way to drop rows where all columns are missing?
pandas' dropna
has a how
argument that specify whether to look for any missing value or all missing value.