[R-sig-Geo] Plan to build Package to use GRASS from R

Roger Bivand Roger.Bivand at nhh.no
Thu Feb 28 08:29:08 CET 2008


On Wed, 27 Feb 2008, Rainer M Krug wrote:

> Hi
>
> Sorry for crossposting, but I think this can be of interest for GRASS and R
> users.

Yes, please avoid cross-posting - the discussion ends up on many different 
lists and threading can break down if the threading implementation in mail 
clients and archives doesn't like cross-posting.

The only complete thread I have found is on Nabble at:

http://www.nabble.com/Plan-to-build-Package-to-use-GRASS-from-R-tt15712877.html#a15712877

for the grass-dev list.

In summary, the problems are mostly those of appropriately quoting shell 
commands through system() across platforms. Those interested should follow 
the discussion on grass-dev.

The correct lists could be either here, or the grass-stats list; could 
Rainer post a summary to both (hopefully in-thread) on conclusion?

Roger

>
> I am planning to write a package to make the use of GRASS from R easier. The
> idea is to wrap the system call to execute the GRASS command into an R
> command of the same name.
> e.g:
> r.to.vect <- function(..., intern=TRUE, ignore.stderr=FALSE)
>  {
>    comm <- paste( "r.to.vect ", ..., sep="" )
>    print(comm)
>    system( comm, intern=intern, ignore.stderr=ignore.stderr )
>  }
>
> My questions are:
>
> 1) Is this a good way of doing it, or is giving a named list to the function
> more usefull?
> 2) Is there a way to obtain easily all commands from GRASS and the
> parameters possible and required?
>
> Any ideas and comments welcome,
>
> Rainer
>
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list