I would like to thank's everyone first, i learn a lot here (gis.stackexchange) about GIS. I have one question about the use of GRASS within R session, i'm able to do some basic task, but i have one important issue is to use GRASS graphics through spgrass6::execGRASS.
I'm aware of the capabilities of R in graphics (lattice, ggplot and others), but i would like to be able to use GRASS graphics because of some option like nviz.
Here is a minimal exemple
require(spgrass6)
require(spatstat)
# to use SpatialGridDataFrame in ggplot
fortify.SpatialGridDataFrame <- function(data) as.data.frame(as.im(as.image.SpatialGridDataFrame(data)))
# initialisation and the use of spearfish60 data
initGRASS(gisBase = "/usr/lib/grass64", home = tempdir(), gisDbase = "/home/dickoa/GIS/grass/grassdata/", location = "spearfish60", mapset = "usr1", override = TRUE)
# verif
gmeta6()
execGRASS("g.list", parameters = list(type = "vect"))
parseGRASS("d.mon")
# and this command gave me errors
execGRASS("d.mon", parameters = list(start="x0"))
and the error message is :
ERREUR :Unable to get GIS_LOCK enviroment variable value
And generaly, i really like the R workflow using emacs (ESS) and the idea of keeping everything in script, it's one of the main raison for me to use grass within R, so i want also to ask for other R and GRASS users if this integration through spgrass6 (Bivand 2011) can allow me to do everything as in interactive session of GRASS.
here is my R session info (i use Kubuntu 10.10 as OS)
R version 2.12.2 (2011-02-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C
[3] LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=fr_FR.UTF-8
[7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets
[7] methods base
other attached packages:
[1] spgrass6_0.6-26 XML_3.2-0 rgdal_0.6-33
[4] sp_0.9-79 spatstat_1.21-5 deldir_0.0-13
[7] mgcv_1.7-4 ggplot2_0.8.9 proto_0.3-9
[10] reshape_0.8.4 plyr_1.4 MASS_7.3-11
loaded via a namespace (and not attached):
[1] lattice_0.19-17 Matrix_0.999375-48 nlme_3.1-98