On Mon, 27 Sep 2010, Maxime Pauwels wrote:
image(rangerp)
image(imgrp)
suggest that contour() will fail, as it does. Are you sure that the
input data are correctly organised?
Roger
Maxime
Le 27/09/2010 13:34, Roger Bivand a ?crit :
On Mon, 27 Sep 2010, Maxime Pauwels wrote:
Hi list,
I have a message error using contourLines and ContourLines2SLDF
functions (maptools package).
rangerp<-read.table("NAhalleri.txt", header=T)
coordinates(rangerp)=~long+lat
gridded(rangerp)=TRUE
proj4string(rangerp)<-CRS("+proj=longlat")
imgrp<-as(rangerp,"SpatialGridDataFrame")
img1rp<-as.image.SpatialGridDataFrame(imgrp["V1"])
CLrp<-contourLines(img1rp, levels=0.0000878882)
CLSLrp<-ContourLines2SLDF(CLrp)
/Error in ContourLines2SLDF(CLrp) : cL too short/
Could anyone help understant what happens?
The levels= value is outside the range of values in img1rp:
library(maptools)
image(volcano)
summary(c(volcano))
CLrp <- contourLines(volcano, levels=70)
CLSLrp<-ContourLines2SLDF(CLrp)
# error
CLrp <- contourLines(volcano, levels=170)
CLSLrp<-ContourLines2SLDF(CLrp)
plot(CLSLrp, add=TRUE)
# OK
Hope this helps,
Roger
Can the input table be too long (3 columns, but almost 300 000 lines)?
Many thanks,
Maxime
Maxime Pauwels
Researcher ID: http://www.researcherid.com/rid/A-1745-2009
Laboratoire de G?n?tique et Evolution des Populations V?g?tales
FRE CNRS 3268
Universit? de Lille, USTL-Lille1
http://gepv.univ-lille1.fr
Tel : +33 3 20 33 62 38
Fax : +33 3 20 43 69 79
?Impose ta chance, serre ton bonheur et va vers ton risque. A te
regarder, ils s'habitueront.?
Ren? Char
[[alternative HTML version deleted]]