Skip to content
Prev 17784 / 29559 Next

Union sp polygons ID (rgoes and sp)

On Sat, 16 Mar 2013, Omphalodes Verna wrote:

            
Well, certainly your example is unclear. You are taking the unions 
byid=TRUE of 5 Polygons objects with the same objects, so if you start 
with

set.seed(1)

you get:
1          2          3          4          5
0.04823433 0.03769229 0.04274933 0.06575346 0.09910228

and
1 1        1 2        1 3        1 4        1 5        2 1
0.04823433 0.06825532 0.09098365 0.11398779 0.14733661 0.06825532
        2 2        2 3        2 4        2 5        3 1        3 2
0.03769229 0.08044161 0.10344575 0.13679457 0.09098365 0.08044161
        3 3        3 4        3 5        4 1        4 2        4 3
0.04274933 0.10850279 0.14076253 0.11398779 0.10344575 0.10850279
        4 4        4 5        5 1        5 2        5 3        5 4
0.06575346 0.14303501 0.14733661 0.13679457 0.14076253 0.14303501
        5 5
0.09910228

where 1 1, 2 2, etc. agree with the single Polygons values. If byid=TRUE, 
you get the union of the two Polygons objects, see:

plot(gU[2])

and

gEquals(gU[2], gU[6])

It isn't clear what you want.

Roger