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

Paulo Flores Ribeiro paulo.flores.mail at gmail.com
Wed Oct 7 11:04:43 CEST 2015


Try change cell size in your ascii text file (eg. instead of «cellsize 
0,0012386489974299», try  «cellsize 10,10»)
Paulo Flores Ribeiro

Às 08:48 de 07-10-2015, ana carolina cuellar escreveu:
> 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]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list