I have a data frame as follows:
col1 col2 col3 1 23 17 NA 2 55 NA NA 3 24 12 13 4 34 23 12
DF <- read.table(text=" col1 col2 col3 1 23 17 NA 2 55 NA NA 3 24 12 13 4 34 23 12", header=TRUE)
This gives the number of rows that contain any NA values in column 2 or 3:
NA
sum(colSums(is.na(DF[,2:3])) > 0) [1] 2