David Hugh-Jones wrote:
> The spRbind methods also complain about non-unique IDs. Is there any
> other difference between them and rbind?
>   
The author is different; I believe I'm responsible for rbind, Roger for 
spRbind. My intention with rbind (and many other generics) was to have 
them behave like it would behave if you applied it to data.frames. 
There's of course a limit to how far you can push that, but the idea is 
that things should work like:

 > a = data.frame(x=1:2,y=3:4,row.names=c("aa", "bb"))
 > a
   x y
aa 1 3
bb 2 4
 > rbind(a,a)
    x y
aa  1 3
bb  2 4
aa1 1 3
bb1 2 4

I.e., the IDs (row.names) should be modified in case they're not unique.

I consider this an omission. Do we have a bugzilla for sp, or is writing 
to this list enough to make a mental note?
--
Edzer
>
> David Hugh-Jones
> PhD Candidate
> Essex University Department of Government
> http://davidhughjones.googlepages.com
>
>
> 2008/7/1 Roger Bivand <Roger.Bivand@nhh.no>:
>   
>> On Tue, 1 Jul 2008, David Hugh-Jones wrote:
>>
>>     
>>> OK, writing
>>> http://wiki.r-project.org/rwiki/doku.php?id=tips:spatial-data:merging,
>>> a question comes up:
>>>
>>> I am trying to rbind() two SpatialLines (or SpatialPolygons or
>>> whatever) objects and I keep getting the error that they have
>>> overlapping IDs - not surprisingly as they were independently created.
>>> Is there a simple way to give new IDs to these objects, and to know
>>> how many I have to give?
>>>       
>> ?spChFIDs in maptools for the methods, but the choice of unique IDs will
>> depend on your domain. The default readOGR IDs are the feature IDs, usually
>> 0:(n-1), which will not be unique. If there are known official codes, like
>> US FIPS codes, they can be used to disambiguate. You can use unique(c(IDs_A,
>> IDs_B)) to proceed. Have you looked at spRbind methods in maptools as an
>> alternative to rbind.* in sp?
>>
>> Roger
>>
>>     
>>> David Hugh-Jones
>>> PhD Candidate
>>> Essex University Department of Government
>>> http://davidhughjones.googlepages.com
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@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@nhh.no
>>
>>
>>     
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   

-- 
Edzer Pebesma
Institute for Geoinformatics (IfGI)
University of Münster
http://ifgi.uni-muenster.de/


	[[alternative HTML version deleted]]


