Remove rows with all NA
but keep any row with at least 1 observation:
dt <- dt[rowSums(is.na(x)) <= 1]
dt <- dt %>%
.[rowSums(is.na(.)) <= 1]
Remove rows with all NA
but keep any row with at least 1 observation:
dt <- dt[rowSums(is.na(x)) <= 1]
dt <- dt %>%
.[rowSums(is.na(.)) <= 1]