[R-sig-Geo] Better print method for Spatial*DataFrames?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri May 28 18:35:38 CEST 2010


On Fri, May 28, 2010 at 5:18 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> On Fri, 28 May 2010, Etienne Bellemare Racine wrote:
>
>> I taught I could add my two cents.
>>>
>>> Nice suggestion!
>>
>> I agree !
>
> No. Only for SpatialPointDataFrame objects, which is what it does already.
> Please, understand that str() is a *much* better choice in effectively all
> cases where summary() isn't used. For the Spatial* objects, set a
> max.level=2 or similar, and you can *see* what is in it. The proposed
> print() method for a big multiband raster will also run away with you. Do
> str(), not print()!!!

 I'm not sure what you're saying 'No' to here, Roger. Neither str(xx)
nor summary(xx) present the object as a data frame. Conceptually its a
data frame where one of the columns is a geometry, and seeing it print
as such is a good thing (imho). I'd like to never have to use xx at data
again!

 I'm not sure trying to truncate the coordinates for nice formatting
is a good idea though, but some indication when printing a
Spatial*DataFrame that its a dataframe with geometries seems a good
idea.

Barry



More information about the R-sig-Geo mailing list