[R-sig-Geo] problems for reading ASCII file

ana carolina cuellar anacarocuellar at gmail.com
Wed Oct 7 09:48:22 CEST 2015


Hi All, I am trying to read an ASCII file into R and is the first time i am
trying to work with ASCII files. I saw a previous discussion that this
command can be used:

library(rgdal)
library(maptools)
grid <- readAsciiGrid("<your file and its path>")
table <- data.frame(grid)

in my case:  grid <- readAsciiGrid("I:/modisv5sm0112_2/prueb/amaascii.txt")


but when i used the readAsciiGrid function i get this error:

Error in validObject(.Object) :

  invalid class “GridTopology” object: cells.dim has incorrect dimension


Can anybody tell me why? i dont get why it doesnt work :(

my ASCII file looks like this:

ncols         260
nrows         193
xllcorner     12,397449031167
yllcorner     55,534017291881
cellsize      0,0012386489974299
NODATA_value  -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 25 25....etc


i am trying to process a raster image (the one i transformed to ASCII)
but it is too big to work with it as a raster in R (i am having memory
problems)...thats why i am trying to see if its simplier to process it
in ASCII and then bring it back to raster.

Thanks a lot!!

Ana

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list