<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<DEFANGED_meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Roger & Edzer,<br>
<br>
Thanks for your help! That did the trick.<br>
<br>
Regards,<br>
Tom<br>
<br>
Roger Bivand wrote:<br>
<blockquote type="cite"
cite="midPine.LNX.4.44.0401230914130.15718-100000@reclus.nhh.no">
<pre wrap="">On Fri, 23 Jan 2004, Edzer J. Pebesma wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
Thomas Adams wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Roger (or anyone else),
I am at an impasse attempting to write an R script to call from within
GRASS. Attached is a code fragment. Basically, I can not get beyond:
summary(bias$mapname)
</pre>
</blockquote>
<pre wrap="">You want the value of mapname to be evaluated: the content is not in
bias$mapname but bias$something, with something the value of the
variable mapname.
Try:
summary(bias[[eval(mapname)]]
</pre>
</blockquote>
<pre wrap=""><!---->
Yes, this is right. There may be a short cut, if you know definitely for
example that there is just one raster in the bias list. Then you access it
by number, for example:
summary(bias[[1]])
The same would apply if there were more, but then it would be easier to
get mixed up.
</pre>
<blockquote type="cite">
<pre wrap="">a <- list(a=NA, b=Inf)
a
</pre>
</blockquote>
<pre wrap=""><!---->$a
[1] NA
$b
[1] Inf
</pre>
<blockquote type="cite">
<pre wrap="">a$a
</pre>
</blockquote>
<pre wrap=""><!---->[1] NA
</pre>
<blockquote type="cite">
<pre wrap="">a[[1]]
</pre>
</blockquote>
<pre wrap=""><!---->[1] NA
</pre>
<blockquote type="cite">
<pre wrap="">a[["a"]]
</pre>
</blockquote>
<pre wrap=""><!---->[1] NA
</pre>
<blockquote type="cite">
<pre wrap="">an <- "a"
a$an
</pre>
</blockquote>
<pre wrap=""><!---->NULL
(no such element in list)
</pre>
<blockquote type="cite">
<pre wrap="">a[[eval(an)]]
</pre>
</blockquote>
<pre wrap=""><!---->[1] NA
Roger
</pre>
<blockquote type="cite">
<pre wrap="">--
Edzer
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177
EMAIL:        <a class="moz-txt-link-abbreviated" href="mailto:thomas.adams@noaa.gov">thomas.adams@noaa.gov</a>
VOICE:        937-383-0528
FAX:        937-383-0033</pre>
</body>
</html>