[R-sig-Geo] kriging inside borders

Chloe ARCHINARD Chloe.ARCHINARD at cefe.cnrs.fr
Fri May 20 10:01:34 CEST 2005


My exact commands are :
library(maptools)
shapefile=read.shape('my.shp')
x=Map2poly(shapefile)

and the length is :
length(mappolys)
[1] 615
 But i'm not sure that it's the good polylist object i need because it's a polygon grid in fact. 
Thank you for your help
Chloé
-----Message d'origine-----
De : Roger Bivand [mailto:Roger.Bivand at nhh.no] 
Envoyé : jeudi 19 mai 2005 19:07
À : Chloe ARCHINARD
Cc : r-sig-geo at stat.math.ethz.ch
Objet : Re: [R-sig-Geo] kriging inside borders

On Thu, 19 May 2005, Chloe ARCHINARD wrote:


> Hello, I'm using geoR package to compute kriging with the function

> krige.conv() and I used maptools (read.shape () + Map2poly () )  and

> splancs (borders) packages to include a object of class polylist for the

> attribute borders.


>  But I've got this message of error when 'borders' is in krige.conv () :  

> krige.conv: there are no prediction locations inside the borders.  My

> polylist is not good? The coordinates seam to be OK when I draw a map

> with this polylist object. And if I use 'borders' in the contour

> function : message error is :


> Error in as.data.frame.default(borders) : can't coerce class "polylist"

> into a data.frame


Firstly, it does help if the exact commands are given, rather than your 

choice of them. I think the main issue here is that a polylist object is a 

list of matrices with attributes, not a matrix. If your polylist object 

is:


x <- Map2poly(read.shape("my.shp"))


what is length(x)? If it is 1, you may be able to say x[[1]] to extract 

the first matrix in the list, but even then it may not work. If you can 

show us the commands you are giving, and the length of your polylist 

object, it should be possible to find something that works. 



> If someone could help me, thanks a lot!


> Chloé Archinard

> 

> 


-- 

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



-- 
passerelle antivirus du campus CNRS de Montpellier
--



-- 
passerelle antivirus du campus CNRS de Montpellier
--




More information about the R-sig-Geo mailing list