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
"Spatial" 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> <<a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>> 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 "Guâno" Grohmann wrote:<br><br>> Hello list<br>><br>> I've away from R a while, and now I'm struggling with it...<br>> I read Bivand's artile in GRASS-News3, but I dindn't understant exactly how
<br>> the data is stored in R.<br>><br><br>Please see a note in R News in November 2005 by Edzer Pebesma and me.<br><br>> If I want to make a trend-surface analysis with surf.ls(), I need the x,y<br>> and z coordinates of each point (or pixel), but I don't know how to get
<br>> these values<br><br>The object returned by getSites6sp() is a SpatialPointsDataFrame. You can<br>get the coordinates by saying:<br><br>pointlayer <- getSites6sp("mypoints")<br>coords <- coordinates(pointlayer)
<br><br>and assuming z is called z:<br><br>myTSA <- 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 <- gstat(id="tr2", formula = z ~ 1, data = pointlayer,
<br> 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>><br>> the whole idea is to make TSA, then variogram fitting in the residuals, then
<br>> krigging (maybe with gstat or geoR, still haven't decided)<br>><br>> thanks<br>><br>> --<br>> +-----------------------------------------------------------+<br>> Carlos Henrique Grohmann - Guano
<br>> Geologist M.Sc - Doctorate Student at IGc-USP - Brazil<br>> Linux User #89721 - carlos dot grohmann at gmail dot com<br>> +-----------------------------------------------------------+<br>> _________________
<br>> "Good morning, doctors. I have taken the liberty of removing Windows 95 from<br>> my hard drive."<br>> --The winning entry in a "What were HAL's first words" contest judged by<br>> 2001: A SPACE ODYSSEY creator Arthur C. Clarke
<br>><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> Carlos
Henrique Grohmann - Guano <br> Geologist M.Sc - Doctorate Student at IGc-USP - Brazil<br>Linux User #89721 - carlos dot grohmann at gmail dot com<br>+-----------------------------------------------------------+<br>_________________
<br>"Good morning, doctors. I have taken the liberty of removing Windows 95 from my hard drive."<br>--The winning entry in a "What were HAL's first words" contest judged by 2001: A SPACE ODYSSEY creator Arthur C. Clarke