Hi, I currently have a dataset 'data' contains more than 100 variables. I am doing some data cleaning right now, and I would like to drop all variables with more than 20% missing values.
Right now I have the following code,
data2 <- data[!map_lgl(data, (is.na(.)))]
But I am getting this error message: Error: Can't convert a logical vector to function
rlang::last_error() to see a backtrace
Is there a better/correct way to do this? Thanks!