[R-sig-Geo] (no subject)

pir2.jv pir2.jv at wanadoo.fr
Thu Sep 28 16:13:24 CEST 2006


Le 28 sept. 06 à 15:06, Roger Bivand a écrit :

>>>   By the way, why the load()?
>>
>> The load is the system response when I click the R.data in the
>> project directory
>
> I think that this is the problem, and that you have an alternative  
> local
> copy of plot that disturbs the method dispatch.
>
> If you say ls(), do the names of any of the objects begin with plot?

 > ls(pat="plot")
[1] "BBplot"             "Bplot"              "draw.plotmath.cell"
[4] "plot"               "plotG"              "plotM"
[7] "plotx"              "plotxx"

plotx, plotxx, plotG and plotM are functions of mine. Is there a  
problem ?

>
>>>
>>> Could you now try plot(xx, axes=TRUE), and then traceback()
>>> immediately
>>> after the error occurs?
>>
>>> plot(xx,axes=TRUE)
>> Erreur dans plot.window(xlim, ylim, log, asp, ...) :
>> 	'xlim' nécessite des valeurs finies
>> De plus : Warning messages:
>> 1: aucun argument trouvé pour min ; Inf est renvoyé
>> 2: aucun argument pour max ; -Inf est renvoyé
>> 3: aucun argument trouvé pour min ; Inf est renvoyé
>> 4: aucun argument pour max ; -Inf est renvoyé
>>> traceback()
>> 4: plot.window(...)
>> 3: localWindow(xlim, ylim, log, asp, ...)
>> 2: plot.default(xx, axes = TRUE)
>> 1: plot(xx, axes = TRUE)
>>
>
> This is where it is going wrong. If you do:
>
> is(xx)

 > is(xx)
[1] "SpatialPolygonsDataFrame" "SpatialPolygons"
[3] "Spatial"
seems to be good

>
> you should see:
>
> [1] "SpatialPolygonsDataFrame" "SpatialPolygons"
> [3] "Spatial"
>
> and method dispatch should choose plot.SpatialPolygons - can you try
>
> plot.SpatialPolygons(xx, axes=TRUE)
>
> directly.


sp:::plot.SpatialPolygons(xx, axes=TRUE)


give a map which seems to be good one !!!
(but I had removed the plot* as below before this instruction)

> I'm fairly certain that the method dispatch of plot is getting
> interfered with, since the class of xx is OK.



Jacques Vernin




More information about the R-sig-Geo mailing list