Suppose I have a dataset as follows:
(dd <- read.table(header = TRUE, text="a b
1 2
NA 1
1 NA
NA NA
1 2
NA 3"))
I think how we can get the number of NA values for a combination of two columns. My output should look like this:
No NA - 2
1st column NA - 2
2nd column NA - 1
Both NA - 1
I do not understand how to do this for a combination of columns. Can anybody help me?
source
share