[R-sig-Geo] "Abridged" description of SpatialPolygonsDataFrame objects?

Roger Bivand Roger.Bivand at nhh.no
Sun Nov 4 21:14:15 CET 2007


On Mon, 29 Oct 2007, Michael Sumner wrote:

> If "d" is a SPolyDF
>
> ## first row/object
> d[1,]
> str(d[1,])
>
> ## the first Polygons object itself  (Polygons can be of many)
> d at polygons[[1]]
> str(d at polygons[[1]])
>
> ## the first Polygon in the first Polygons object
> d at polygons[[1]]@Polygons[[1]]
> str(d at polygons[[1]]@Polygons[[1]])
>

Another possibility is to use the arguments to str(), in particular, 
setting max.level=2 prevents str() going into deeper levels of the nested 
object. Judicious use of slot() in str(), with the max.level= gives a good 
degree of control.

Roger

>
>
> Agustin Lobo wrote:
>> Hi!
>>
>> If I do str(a) where a is a SpatialGridDataFrame, I get
>> a description of the structure that is readable,
>> but for SpatialPolygonsDataFrame the output of str() is
>> too long. Is there any way of looking at the
>> structure of a SpatialPolygonsDataFrame object just down to
>> a certain level? For example, not getting the structure of the
>> each polygon but getting the first one only.
>>
>> Thanks
>> Agus
>>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

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




More information about the R-sig-Geo mailing list