0

I am new in R. I want to check my entries in my column which is in a dataframe then remove the entry if it is not correct. In my column there should be only 1 and 2 but sometimes I do see 0. I want to remove 0. Can I use na.omite() function?

kg1352
  • 20
  • 2
  • Try: `cleanData <- myData[ myData$myColumn != 0, ]` – zx8754 Oct 27 '20 at 09:37
  • Will it remove only 0? – kg1352 Oct 28 '20 at 12:55
  • Yes, it will keep rows that are not zero, or if you wish to keep rows with certain values, try: `cleanData <- myData[ myData$myColumn %in% c(1, 2), ]`. Please see the linked post, and read up on R basics. – zx8754 Oct 28 '20 at 13:06

0 Answers0