I have a dataframe with 5000 columns and 1000 rows but a lot of data are missing. I'm interested only on columns that have at least 10 data. How to remove columns with less than 10 values? Thank you!
I tried:
miss <- c()
for(i in 1:ncol(test)) {
if(length(test[,i]) < 10)
miss <- append(miss,i)
}
data2 <- test[,-miss]
Error in -miss : invalid argument to unary operator