[R-sig-Geo] check all IDs of a spatialPolygons object

Agustin Lobo alobolistas at gmail.com
Thu May 20 15:05:29 CEST 2010


Yes!
I would have thought on that if spol where a spatialpolygonsDataFrame,
(as many sp functions for SpPolDF actually mimic functions for
dataframes, which is
great help for the memory), but in this case, spol is just a
spatialpolygons and the user
probably will not think at that.

Thanks!
Agus

2010/5/20 Roger Bivand <Roger.Bivand at nhh.no>:
> On Thu, 20 May 2010, Agustin Lobo wrote:
>
>> Is there a cleaner way to check all IDs of a spatialPolygons object?
>> I know how to do it with one:
>> > slot(spol at polygons[[2]],"ID")
>> [1] "g2"
>>
>> and for all of them I use
>>>
>>> sapply(spol at polygons,slot,"ID")
>>
>> is there something more straightforward, sort of spFIDs() (by analogy
>> to spChFIDs() )?
>
> row.names(spol), OK?
>
> Roger
>
>>
>> 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