I try to read one ncdf file ,
in the header written that missing value is “Missval:1e+30” but in the data I see 9999 .
I check with ncdump in linux , and it’s fine. and missing value recognize by that.
how can I tackle with such problem to get rid of missing values?
head(get.var.ncdf(nc,4))
[1] 9999 9999 9999 9999 9999 9999
R uses the special symbol
NAto code missing values.If your data has 9999 to code missing values, then your metadata header is lying, and you will have to replace them manually. Generally, you would do something like:
Replacement for matrix objects is similar. And basic R stuff.
Its possible that you already have some NA values in your data, as well as the 9999 values. Check with
any(is.na(x))– if TRUE, there’s at least one NA in there (which probably came from the missing data value in the header).