<div dir="ltr">Hi Rainer, <div>This clarifies things a great deal. I'll try it and let you know, but it makes sense so I don't anticipate needing an example. </div><div>Thank you!</div><div>Marisa</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 8:22 PM, Rainer M Krug <span dir="ltr"><<a href="mailto:r.m.krug@gmail.com" target="_blank">r.m.krug@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Envoyé de mon iPhone<br>
<span class=""><br>
> Le 10 sept. 2015 à 16:47, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> a écrit :<br>
><br>
> Hi Rainer,<br>
><br>
>> On Thu, Sep 10, 2015 at 4:36 PM, Rainer M Krug <<a href="mailto:Rainer@krugs.de">Rainer@krugs.de</a>> wrote:<br>
>> ...<br>
>> Just check out the rgrass7 package - readRAST() allows you to read your<br>
>> raster, then you do your calculations with the data,<br>
><br>
> ... this calculation part is the question of Marisa... any recommended<br>
> tutorials on how to loop over pixels in R after having used<br>
> readRAST()?<br>
<br>
</span>The data slot of the returned SpatialGridDataFrame is simply a data.frame with one cell per row. So you can simply iterate over each row and add the results as a new column, which you can then save. If the function is vectorizes, you don't even have to iterate but R can do the work. If necessary, I can send you a small example tomorrow- just let me know.<br>
<br>
Hope this helps,<br>
<br>
Rainer<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
>> then you add them<br>
>> to the map object in R and finally you can safe them by using<br>
>> writeRAST() back to GRASS.<br>
><br>
> Yes, that part is clear. Just the "loop" best practice not so much.<br>
><br>
> thanks<br>
> Markus<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><span style="color:rgb(153,153,153)"><span style="background-color:rgb(255,255,255)">Marisa Donnelly<br></span></span></div><span style="color:rgb(153,153,153)"><span style="background-color:rgb(255,255,255)">Ph.D. Student<br>Graduate Group in Epidemiology<br></span></span></div><span style="color:rgb(153,153,153)"><span style="background-color:rgb(255,255,255)">University of California, Davis<br></span></span></div><span style="color:rgb(153,153,153)"><a href="mailto:madonnelly@ucdavis.edu" target="_blank">madonnelly@ucdavis.edu</a></span><br></div></div>
</div>