Dear list,
I am running R within a GRASS session. I am trying to convert a
SpatialGridDataFrame to a raster GRASS format using the writeRAST6
function. Because the script is inside a for loop I am using the overwrite
flag to create always a temporal Grass raster file, but it does not work.
Here is the code:
class(f)
[1] "SpatialGridDataFrame"
attr(,"package")
[1] "sp"
I would like to create a Grass raster file "temp" which is already there
from the first run of the loop
Error: option <output>: <temp> exists.
Warning message:
In is.na(pt[, "keydesc_count"]) :
is.na() applied to non-(list or vector) of type 'NULL'
What I can do is to write at the beginning of the for loop a line to
delete the file "temp" (system(g.remove rast=temp)) but the overwrite
possibility is more elegant....
I'd appreciate any help.
Jaime
I am using GRASS 6.2.3
sessionInfo()
R version 2.9.2 (2009-08-24)
x86_64-pc-linux-gnu
locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RColorBrewer_1.0-2 spdep_0.4-36 Matrix_0.999375-30
lattice_0.17-26
[5] spam_0.15-4 boot_1.2-40 tripack_1.3-3 ncf_1.1-3
[9] spgrass6_0.6-8 XML_2.6-0 classInt_0.1-11
maptools_0.7-25
[13] foreign_0.8-38 e1071_1.5-19 class_7.2-48 rgdal_0.6-17
[17] sp_0.9-43
loaded via a namespace (and not attached):
[1] grid_2.9.2 tools_2.9.2