0

How can I set my NA to two different things?

My data set uses 0 and nd to represent missing data and I got my code to work for one value, but I cannot get it for both.

I tried to separate NA = and a comma, but I cannot get it to work.

Also, this is the way I have to do this, and I am a beginner programmer so please keep it simple

seals <- read_csv("SealData.csv", na =  "nd", "0")
Karianney
  • 1
  • 1
  • 2

1 Answers1

2

If you want to specify multiple NA values, you need to use c().

 seals <- read_csv("SealData.csv", na.strings =  c("nd", "0"))
M--
  • 25,431
  • 8
  • 61
  • 93
shirewoman2
  • 1,842
  • 4
  • 19
  • 31
  • 1
    *Whenever you want to specify multiple values, you need to use "c()".* ...This is **not right.** – M-- Jan 20 '20 at 18:58
  • Oops! Typo when I copied and pasted code from user's question. Thanks, M. – shirewoman2 Jan 20 '20 at 19:10
  • Yes, that was an issue you figured on your own. I was talking about the word *Whenever*. Sometimes, you need to use `list()`, etc. I changed the text above your code to be exclusive to this question. Cheers. – M-- Jan 20 '20 at 19:12
  • @M-- True! Thanks – shirewoman2 Jan 20 '20 at 19:27