import - R - raster function NAs values lower than -9999 in ASCII file -
i have been having problems importing ascii raster has values go min. :-69826220
max. :167780500
. problem encountering when use raster function import ascii file every value smaller -9999
reported na
, minimum value -9458
.
is bug of function , there workaround? when import same ascii file data frame fine , whole range of values. using same procedure import other ascii rasters , don't have problem.
here link ascii file https://dl.dropboxusercontent.com/u/24234831/ps0011yme.asc
here session info, opened new session in case.
sessioninfo() r version 3.0.0 (2013-04-03) platform: x86_64-w64-mingw32/x64 (64-bit)
locale: [1] lc_collate=english_united states.1252 [2] lc_ctype=english_united states.1252
[3] lc_monetary=english_united states.1252 [4] lc_numeric=c
[5] lc_time=english_united states.1252
attached base packages: [1] stats graphics grdevices utils datasets methods base
other attached packages: [1] raster_2.1-16 sp_1.0-8
loaded via namespace (and not attached): [1] grid_3.0.0 lattice_0.20-15
any appreciated
you can try use setminmax()
on raster file try , work out min , max values , store them in returned raster* object. try so:
r <- setminmax( raster("path/to/myraster.asc") )
i not sure happening because if downlaod data , do:
r1 <- raster( "~/downloads/test.asc") summary(values(r1)) min. 1st qu. median mean 3rd qu. max. na's -69830000 -4789000 737300 16950000 13880000 167800000 71468
please add output of sessioninfo()
into question , i.e. not comment.
the errors in case being caused not having rgdal
installed, bindings geospatial data abstraction library , important importing/exporting raster , shapefile data.