[GRASSLIST:10501] Re: help with R and GRASS6

Carlos "Guâno" Grohmann carlos.grohmann at gmail.com
Tue Feb 21 17:20:42 EST 2006


Roger, thanks for you help

I managed to get things in R and get a trend surface with surf.ls.
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?

thanks again

Carlos


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


--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows 95 from
my hard drive."
--The winning entry in a "What were HAL's first words" contest judged by
2001: A SPACE ODYSSEY creator Arthur C. Clarke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20060221/e6c24cd6/attachment.html


More information about the grass-user mailing list