Roger, thanks for you help<br>
<br>
I managed to get things in R and get a trend surface with <a href="http://surf.ls">surf.ls</a>. <br>
The thing is that I want to model a variogram on the residuals of this
surface, and I don't know how to pick up this residuals (the $wz of my
trend), and put them into some way that gstats understands it. How can
I assingn coordinates to the values, and make them some object of
&quot;Spatial&quot; class?<br>
<br>
thanks again<br>
<br>
Carlos<br>
<br><br><div><span class="gmail_quote">On 2/21/06, <b class="gmail_sendername">Roger Bivand</b> &lt;<a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Carlos,<br><br>On Tue, 21 Feb 2006, Carlos &quot;Guâno&quot; Grohmann wrote:<br><br>&gt; Hello list<br>&gt;<br>&gt; I've away from R a while, and now I'm struggling with it...<br>&gt; I read Bivand's artile in GRASS-News3, but I dindn't understant exactly how
<br>&gt; the data is stored in R.<br>&gt;<br><br>Please see a note in R News in November 2005 by Edzer Pebesma and me.<br><br>&gt; If I want to make a trend-surface analysis with surf.ls(), I need the x,y<br>&gt; and z coordinates of each point (or pixel), but I don't know how to get
<br>&gt; these values<br><br>The object returned by getSites6sp() is a SpatialPointsDataFrame. You can<br>get the coordinates by saying:<br><br>pointlayer &lt;- getSites6sp(&quot;mypoints&quot;)<br>coords &lt;- coordinates(pointlayer)
<br><br>and assuming z is called z:<br><br>myTSA &lt;- surf.ls(2, x=coords[,1], y=coords[,2], z=pointlayer$z)<br><br>but you can also do TSA straight away in gstat:<br><br>myTSA_with_gstat &lt;- gstat(id=&quot;tr2&quot;, formula = z ~ 1, data = pointlayer,
<br>&nbsp;&nbsp;degree=2)<br><br>(the most recent gstat just takes the location coordinates from the<br>SpatialPointsDataFrame object.)<br><br>There was a thread about this recently, I think copied to:<br><br><a href="http://grass.gdf-hannover.de/twiki/pub/GRASS/WebHome/krigingusingRGRASS6.txt">
http://grass.gdf-hannover.de/twiki/pub/GRASS/WebHome/krigingusingRGRASS6.txt</a><br><br>where a grid is created from the GRASS region settings to predict to.<br><br>Hope this helps,<br><br>Roger<br><br>&gt;<br>&gt; the whole idea is to make TSA, then variogram fitting in the residuals, then
<br>&gt; krigging (maybe with gstat or geoR, still haven't decided)<br>&gt;<br>&gt; thanks<br>&gt;<br>&gt; --<br>&gt; +-----------------------------------------------------------+<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Carlos Henrique Grohmann - Guano
<br>&gt;&nbsp;&nbsp; Geologist M.Sc&nbsp;&nbsp;- Doctorate Student at IGc-USP - Brazil<br>&gt; Linux User #89721&nbsp;&nbsp;- carlos dot grohmann at gmail dot com<br>&gt; +-----------------------------------------------------------+<br>&gt; _________________
<br>&gt; &quot;Good morning, doctors. I have taken the liberty of removing Windows 95 from<br>&gt; my hard drive.&quot;<br>&gt; --The winning entry in a &quot;What were HAL's first words&quot; contest judged by<br>&gt; 2001: A SPACE ODYSSEY creator Arthur C. Clarke
<br>&gt;<br><br>--<br>Roger Bivand<br>Economic Geography Section, Department of Economics, Norwegian School of<br>Economics and Business Administration, Helleveien 30, N-5045 Bergen,<br>Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
<br>e-mail: <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>+-----------------------------------------------------------+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Carlos
Henrique Grohmann - Guano&nbsp;&nbsp; <br>&nbsp;&nbsp;Geologist M.Sc&nbsp;&nbsp;- Doctorate Student at IGc-USP - Brazil<br>Linux User #89721&nbsp;&nbsp;- carlos dot grohmann at gmail dot com<br>+-----------------------------------------------------------+<br>_________________
<br>&quot;Good morning, doctors. I have taken the liberty of removing Windows 95 from my hard drive.&quot;<br>--The winning entry in a &quot;What were HAL's first words&quot; contest judged by 2001: A SPACE ODYSSEY creator Arthur C. Clarke