TR: [R-sig-Geo] kriging inside borders

Roger Bivand Roger.Bivand at
Mon May 23 16:21:50 CEST 2005

On Mon, 23 May 2005, Chloe ARCHINARD wrote:

> Overlay function is an interesting function, it seems to work good!
> It's very useful to create the prediction location for kriging : 
> predict <- coordinates(xp[!])
> kc=krige.conv(geodata,loc=predict,
> krige=krige.control(type.krige="ok",cov.model="spherical",
> there's no error message but I can't plot the kriging prediction. With :
> image(kc)
> Error in image.default(x = c(1275000, 1285000, 1295000, 1305000, 1315000,  : 
>         dimensions of z are not length(x)(+1) times length(y)(+1)
> In addition: Warning message: 

> data length [2683] is not a sub-multiple or multiple of the number of
> rows [33] in matrix
> I tried with another shapefile.shp, which is after and
> Map2poly() a polylist object of length [[1]], so I can use this for
> borders() in krige.conv(). Kriging runs well but the result of contour()
> present problems! See the map! I don't have enough time to think more
> about that, but if I understand the problem I send you an answer. Thank
> you for your help!

Firstly, your postings with attachments are being rejected by the mailing
list, so please try to post them on a website/homepage if you want the
list to see them.

Neither standard contour() nor standard image() are going to work on data 
in a different format than they understand. That is why using the 
SpatialPixel format is so nice, a regular but incomplete grid is made into 
a suitable format for plotting (there are other ways than spplot(), but 
this function is particularly flexible). Unfortunately, everything takes 


> Chloé 

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

More information about the R-sig-Geo mailing list