How to combine two sums functions into one code which would give an output as the table in the following style?

I have written the following two codes in R.The first one returns the value 41 and the second one returns 9.

sum(dflapop2$missingsalary==1 & is.na(dflapop2$age))
sum(dflapop2$missingsalary==1 & is.na(dflapop2$edlevel))

I want both codes combined in one, which would return the following table:

age  edlevel
 41        9

Any idea how I could do this?

%d bloggers like this: