0

I want to remove rows in the dataset where a column 'ABC' contains NA,

so I write:

dataset = dataset[dataset$ABC !='NA',]

the result:

instead of removing those rows that column 'ABC' is NA, it changes every column of those rows to NA

Example:

row     AAA   BBB   ABC
1        3     2     1
2        3     3     NA
3        1     2     3

result:

row     AAA   BBB   ABC
1        3     2     1
2        NA    NA    NA
3        1     2     3

where am I wrong? Thanks

MrFlick
  • 178,638
  • 15
  • 253
  • 268
lserlohn
  • 5,206
  • 10
  • 30
  • 51

0 Answers0