universal kriging in gstat

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

universal kriging in gstat

Ali Santacruz
Dear list members,

I am trying to perform universal kriging in gstat, and according to the help
of 'krige' function, the names of the coordinates of 'newdata' argument must
be the same as defined in 'locations'.

I am creating an SpatialPixels object for the prediction locations, using
the next code:

>pts<-spsample(myShapePoly, n=3000, "regular")
>gridded(pts) <- TRUE class(pts)
[1] "SpatialPixels"
attr(,"package")
[1] "sp"

And x1 and x2 are the names of the coordinates of the prediction locations
grid.

So, to perform universal kriging, I have to change the names of the
coordinates of my observed data to x1 and x2, but I would like to know if I
can change the name of the coordinates of the prediction grid ('pts').

I appreciate any comment. Sincerely,

Al? M. Santacruz
M.Sc. Geomatics, Student
National University of Colombia
Bogot? D.C.



Reply | Threaded
Open this post in threaded view
|

universal kriging in gstat

Edzer J. Pebesma-2
Al? Santacruz wrote:
> Dear list members,
>
> I am trying to perform universal kriging in gstat, and according to the help
> of 'krige' function, the names of the coordinates of 'newdata' argument must
> be the same as defined in 'locations'.
>  
I suspect it is time to update this documentation; If you're using sp
objects, the names of coordinates does not play a role anymore, as
we can retrieve them using the coordinates() method.

Does this help?
--
Edzer

> I am creating an SpatialPixels object for the prediction locations, using
> the next code:
>
>  
>> pts<-spsample(myShapePoly, n=3000, "regular")
>> gridded(pts) <- TRUE class(pts)
>>    
> [1] "SpatialPixels"
> attr(,"package")
> [1] "sp"
>
> And x1 and x2 are the names of the coordinates of the prediction locations
> grid.
>
> So, to perform universal kriging, I have to change the names of the
> coordinates of my observed data to x1 and x2, but I would like to know if I
> can change the name of the coordinates of the prediction grid ('pts').
>
> I appreciate any comment. Sincerely,
>
> Al? M. Santacruz
> M.Sc. Geomatics, Student
> National University of Colombia
> Bogot? D.C.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



Reply | Threaded
Open this post in threaded view
|

universal kriging in gstat

Ali Santacruz
Thanks Edzer,

Yes, I found that the answer was very simple: as you say, we can use the
coordinates() method.

Best regards,

Al? Santacruz



>From: "Edzer J. Pebesma" <e.pebesma at geo.uu.nl>
>To: Al? Santacruz <amsantac at hotmail.com>
>CC: r-sig-geo at stat.math.ethz.ch
>Subject: Re: [R-sig-Geo] universal kriging in gstat
>Date: Mon, 03 Jul 2006 17:40:27 +0200
>
>Al? Santacruz wrote:
>>Dear list members,
>>
>>I am trying to perform universal kriging in gstat, and according to the
>>help of 'krige' function, the names of the coordinates of 'newdata'
>>argument must be the same as defined in 'locations'.
>>
>I suspect it is time to update this documentation; If you're using sp
>objects, the names of coordinates does not play a role anymore, as
>we can retrieve them using the coordinates() method.
>
>Does this help?
>--
>Edzer
>>I am creating an SpatialPixels object for the prediction locations, using
>>the next code:
>>
>>
>>>pts<-spsample(myShapePoly, n=3000, "regular")
>>>gridded(pts) <- TRUE class(pts)
>>>
>>[1] "SpatialPixels"
>>attr(,"package")
>>[1] "sp"
>>
>>And x1 and x2 are the names of the coordinates of the prediction locations
>>grid.
>>
>>So, to perform universal kriging, I have to change the names of the
>>coordinates of my observed data to x1 and x2, but I would like to know if
>>I can change the name of the coordinates of the prediction grid ('pts').
>>
>>I appreciate any comment. Sincerely,
>>
>>Al? M. Santacruz
>>M.Sc. Geomatics, Student
>>National University of Colombia
>>Bogot? D.C.
>>
>>_______________________________________________
>>R-sig-Geo mailing list
>>R-sig-Geo at stat.math.ethz.ch
>>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>

_________________________________________________________________
MSN Amor: busca tu ? naranja http://latam.msn.com/amor/