# [R] Kriging function ("prmat" and "semat") in spatial package

Yan Yu yanyu at cs.ucla.edu
Thu May 8 21:36:46 CEST 2003

```Thanks a lot for clarification!
Please forgive my ignorance on some R basics,
It is good to know that all R matrices are stored in column first order:)
it would be nice if it could be documented, so that new users to R can
quickly get to where they want w/o first going through some systematic R
learning..

thanks,
yan

On Thu, 8 May 2003, Prof Brian Ripley wrote:

> On Thu, 8 May 2003, Yan Yu wrote:
>
> > Hello, there, I have two Qs about the kriging function in spatial pakcage.
> >
> > (1) From what I read in some textbooks,
> > Kriging procedure is supposed to honor the sample data point, which means
> > at the sampling data point, the kriging value should be the same as the
> > input value, and the estimation variance(error) is 0.
> > but from my initial experience with "prmat" and "semat" function in the
> > "spatial" package, this is not true.
> > I am wondering did anyone  used those kriging functions have similar
> > experience? OR I used it wrong? (although I believe I used the function
> > correctly:)
>
> was written to support?  Note that prmat and semat are not predicting at
> the data points.  Even if you predict at the same point, this is taking a
> new sample, not the previous sample.  So it will interpolate iff there is
> no nugget effect: computationally you may see small inaccuracies since the
> distances are binned.
>
> > (2) if consider x coordinate as row index, and y coordinate as column
> > index, the returned value from prmat, and semat seems to be stored
> > in column first order(i.e., first the 1st column, then the 2nd column..).
> > since the data order of returned valus is NOT explicitly specified in the
> > manual, and almost data from everywhere else I have seen is stored in row
> > first order, It would be nice if someone could confirm me on this.
>
> *All* R matrices are stored in column first order ... so why does this
> need to be specified on that help page?
>
>

```