On 2011-05-13 06:42, Vickie S wrote:
Hi naive question. It is possible to get R command for omitting rows or cols with missing values present. But if i want to omit rows or cols with i.e .>20% missing values, I couldĀ“t find any package-based command, probably because it is too simple for anyone to do that manually, though not for me. Can anyone please help me ?
Example: set.seed(2718) m <- matrix(sample(1:9, 100, TRUE), 10, 10) is.na(m) <- sample(100, 20) d <- as.data.frame(m) d[rowSums(is.na(d)) / nrow(d) <= 0.2,] d[colSums(is.na(d)) / ncol(d) <= 0.2,] Peter Ehlers ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.