Hello there,
There are a couple of ways to perform what you require. Let looks at this example:
library(tidyverse)
sleep <- data.frame(
Dream = c(1,2,3,4,5,NA),
Dream2 = c(1,2,3,NA,5,NA))
sum(is.na(sleep))
#> [1] 3
output <- sapply(sleep,is.na)
output
#> Dream Dream2
#> [1,] FALSE FALSE
#> [2,] FALSE FALSE
#> [3,] FALSE FALSE
#> [4,] FALSE TRUE
#> [5,] FALSE FALSE
#> [6,] TRUE TRUE
sum(output)
#> [1] 3
Created on 2020-09-30 by the reprex package (v0.3.0)
You will see that given how you called your data I also have a dataframe called sleep with both Dream and Dream2. You can simply pass in the dataframe or if you want to apply it for each column you have you can simply run it with an sapply which does it for all columns in sleep. As you see it leads to the same result
Let me know if this is a sufficient solution to your problem.