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
  • 195,160
  • 17
  • 277
  • 295
lserlohn
  • 5,878
  • 10
  • 34
  • 52

0 Answers0