Which(is.na()) gives wrong row

Viewed 30

I am using the command which(is.na(variable)) always gives me the wrong row number. It is off by 3 for those variables I checked. Unfortunately, I cannot give reproducible code. I tried with the included data set air quality in r and it works. Are there any reasons why this could be? Duplicates perhaps? I check for duplicates tho and remove them and I also remove some variables that were clearly impossible observations. However, I can't explain why it should be off. I understand it will be very difficult to infer anything without having the code but perhaps there is a common cause to this.

Thanks.

0 Answers
Related