Consider a data frame from a csv file. The chosen data frame has observed values and a column that contains the date( a measurement that has been taken).
Just in case if the record isn't present then it contains the value as NA for missing data.
Col1 Col2
10 2018/01/01
20 NA
30 2018/05/01
We would like to use the subset command to define a new data frame. This new data frame contains only rows taht have NA values from the column(Col2).
In the example given, only Row 2 will be contained in the new data frame.
The command is as follows:
new_data<-subset(data,data$Col2=="NA")
This does not work, as the resulting data frame has no row entries.
In the original csv file, the values NA are exchanged with NULL.
The same command produces the desired result:
new_data<-subset(data,data$Col2=="NULL").
How can I get this method working, if for the character string the value NA is provided in the original .csv file?