[R-sig-Geo] Error in ContourLines2SLDF(CLrp) : cL too short

Maxime Pauwels Maxime.Pauwels at univ-lille1.fr
Mon Sep 27 15:57:43 CEST 2010


  Hi,

can't be so easy.
summary(imgrp)
#gives
#Object of class SpatialGridDataFrame
#Coordinates:
# min max
#long -4.520934 30.02093
#lat 39.978933 55.02107
#Is projected: FALSE
#proj4string : [+proj=longlat]
#Number of points: 2
#Grid attributes:
# cellcentre.offset cellsize cells.dim
#long -4.5 0.04186893 825
#lat 40.0 0.04213483 357
#Data attributes:
# Min. 1st Qu. Median Mean 3rd Qu. Max.
#5.23000e-08 4.45000e-06 2.26000e-05 1.98700e-04 1.90000e-04 6.01600e-03
NA's
1.97048e+05

However, I have a problem since:
range(img1rp)
#[1] NA NA

max



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]]
>>
>>
>


-- 
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



More information about the R-sig-Geo mailing list