[GRASS-user] running /grass/script/v.db.* from R session

,

Dear all,

I am able to run all .exe commands of grass inside a R session.
But now I need to run scripts (not .exe) like v.db.addcol
and R is returning an error message.

system(paste(“v.db.addcol ANA_COD5_arstream_vect_”,sprintf(“%05d”, sws),“th0010 columns=“,”"“,“ANA_COD5 varchar(15)”,”"“,sep=”"))
Warning message:
In system(paste("v.db.addcol ANA_COD5_arstream_vect
”, sprintf(“%05d”, :
Impossible to run c:\OSGeo4W\apps\grass\GRASS-~1.0SV\scripts\VDB~1.ADD ANA_COD5_arstream_vect_07437_th0010 columns=“ANA_COD5 varchar(15)”

sessionInfo()
R version 2.9.0 alpha (2009-03-26 r48224)
i386-pc-mingw32
locale:
LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_MONETARY=English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] foreign_0.8-34 spgrass6_0.6-5 XML_2.5-1 rgdal_0.6-7 sp_0.9-32 fortunes_1.3-6
loaded via a namespace (and not attached):
[1] grid_2.9.0 lattice_0.17-20

Any help before midnight (of Canada) are welcome :slight_smile:

milton

Milton Cezar Ribeiro wrote:

I am able to run all .exe commands of grass inside a R session.
But now I need to run scripts (not .exe) like v.db.addcol
and R is returning an error message.

> system(paste("v.db.addcol ANA_COD5_arstream_vect_",sprintf("%05d",
sws),"_th0010 columns=","\"","ANA_COD5 varchar(15)","\"",sep=""))
Warning message:
In system(paste("v.db.addcol ANA_COD5_arstream_vect_", sprintf("%05d", :
  Impossible to run c:\OSGeo4W\apps\grass\GRASS-~1.0SV\scripts\VDB~1.ADD
ANA_COD5_arstream_vect_07437_th0010 columns="ANA_COD5 varchar(15)"

First, ensure that $GISBASE/scripts isn't in the path if you're
running native Windows applications. Second, ensure that $GRASS_SH
contains the path to MSys' bash.

On Windows, each shell script in $GISBASE/scripts should have a
corresponding batch file in $GISBASE/bin. The batch file invokes the
script via %GRASS_SH%, which should contain the path to MSys' bash.

Also, start by trying to run scripts with arguments which don't
contain spaces or quotes. It's possible that we haven't got that case
correct yet (or that you need to do something within R to deal with
this).

--
Glynn Clements <glynn@gclements.plus.com>