I want to delete a row from a data frame XYZ where A == "TRUE". Let's assume there are five variables in this data frame XYZ. My deletion is based on the TRUE vs. FALSE value under variable A. How do I do this? Thanks!
My current code: for (i in 1:length(XYZ$A)) if (XYZ$A == "FALSE") XYZ<-XYZ else XYZ<- XYZ[-i,] Error message is: Error in if (XYZ$A == "FALSE") XYZ<-XYZ else XYZ<- XYZ[-i, : missing value where TRUE/FALSE needed Please help!! -- View this message in context: http://www.nabble.com/How-do-I-delete-a-row-from-a-data-frame-when-varA-%3D%3D-%22TRUE%22-tp24599876p24599876.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.