[R-sig-Geo] Grass and raster package

Roger Bivand Roger.Bivand at nhh.no
Mon Oct 25 14:31:00 CEST 2010


On Mon, 25 Oct 2010, Martin wrote:

>
> i found a solution, if someone else is interested:
>
> system("g.mlist type=rast pattern='lin*' >tmp")
>
> k=c(scan("tmp", what='string'))

Indeed, using GRASS itself often helps! You can simplify to:

k <- execGRASS("g.mlist", parameters=list(type="rast",
   pattern="'elev*'"), intern=TRUE)

(example tried in spearfish, also works in Linux with pattern="elev*")

Roger

>
> x=readRAST6(k)
>
> b=brick(x)
>

-- 
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