<div>Hi Markus,</div>
<div> </div>
<div>Under windows I needed only small changes</div>
<div> </div>
<div>rasterfiles <- read.table(textConnection(system("g.mlist.exe rast pattern=*output*", intern = TRUE)))<br></div>
<div>Thanks a lot,</div>
<div> </div>
<div>milton<br><br></div>
<div class="gmail_quote">2009/5/4 Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Mon, May 4, 2009 at 8:57 PM, Milton Cezar Ribeiro<br><<a href="mailto:miltinho.astronauta@gmail.com">miltinho.astronauta@gmail.com</a>> wrote:<br>> Dear all,<br>><br>> I am running R inside GRASS 6.4 and I can see a list<br>
> of all my raster files when I type (from the R session)<br>><br>> system("g.list rast")<br>><br>> But I would like to pass the list of rasters to a vector object in R.<br>><br>> I tryed innocently this, but not worked:<br>
><br>> my.rast.list<-system("g.list rast")<br><br></div>Try this:<br><br>> rasterfiles <- read.table(textConnection(system("g.mlist rast",intern = TRUE)))<br>> str(rasterfiles)<br>'data.frame': 42 obs. of 1 variable:<br>
$ V1: Factor w/ 42 levels "aspect","basin_50K",..: 31 1 2 3 4 5 6 7 8 9 ...<br>> rasterfiles<br> V1<br>1 myfacility<br>2 aspect<br>3 basin_50K<br>
4 boundary_county_500m<br>...<br>
<div class="im"><br>> I also would like to define a pattern of raster names to the g.list command,<br>> like only return that raster names that have "_output_" on the name.<br><br></div>So:<br>> rasterfiles <- read.table(textConnection(system("g.mlist rast pattern="*_output_*",intern = TRUE)))<br>
> str(rasterfiles)<br>
<div class="im"><br><br><br>> By the way, I am running GRASS inside MSYS, under windows.<br><br></div>Please report if above works (as it does on Linux).<br><font color="#888888"><br>Markus<br></font></blockquote></div>
<br>