R 3.3.0; Missing values not recognized as NA during read.csv - Workaround

r
missing_values

#1

Hello everyone. Thought of sharing the workaround taken for missing values not represented as NA.

I was trying to figure out the NA’s in the dataset and post initial import I kept getting 0 TRUEs for is.na() and the dataset did have several missing values. Screenshot was also provided in the workshop tutorial. I realized that R did not convert the missing values to NA.

I found the following answer on stack overflow that helped me get the NAs:

test <- read.csv(“test_2AFBew7.csv”, header=T, na.strings=c(""))

Thought it might be helpful for someone who didnt know this.


#2

@sagard21 - The missing value is in the form of empty space in your data set .So you have to treat it accordingly.The above code explaining it that the missing value which is blank space does not count them.

Hope this helps!

Regards,
Hinduja


#3

Indeed.

Thanks buddy :slight_smile:


Experiments with Data Workshop doubts