I want to create a vector of column names for columns that have fewer than 3 NAs. Here is my data and what I have tried so far:
df <- data.frame("A" = c(1,3,4,6,NA,3,NA),
"B" = c(2,4,5,6,7,8,9),
"C" = c(3,4,NA,NA,2,3,NA))
NA.list <- map(df, function (x) sum(is.na(x))>=3)
I want to create an output that is similar to this:
names <- c("A", "B")
Any thoughts?