Hi Prof. Roger,

It worked so fine!
I think that when you publish the forthcoming book we will require less of
your precious time!
Indirectly You are contributing so much with the Brazilian Atlantic Forest
Biodiversity conservation.

Kindly,

miltinho




On 6/12/08, Roger Bivand <Roger.Bivand@nhh.no> wrote:
>
> On Thu, 12 Jun 2008, milton ruser wrote:
>
> Dear all,
>>
>> I have a sequence of polygons as the example below. As the number of
>> polygons will change every time, I would like to add a new object of class
>> "Polygons" to a SpatialPolygons. Look that on the last time I try to add a
>> new "Polygons" and get an error. How can I do dat?
>>
>
> Almost there - just catenate the "polygons" slot with the new "Polygons"
> object(s):
>
> my.pols.SpatPol.complete <- SpatialPolygons(c(slot(my.pols.SpatPol.partial,
>  "polygons"), list(my.pol3.Sr <http://my.pol3.sr/>)))
>
> Roger
>
>
>> Kind regards,
>>
>> miltinho
>>
>> -----
>>
>> require(maptools)
>> my.pol1<-cbind(x=c(3,7,7,3,3),y=c(2,2,6,6,2))
>> my.pol2<-cbind(x=c(6,9,9,6,6),y=c(4,4,9,9,4))
>> my.pol3<-cbind(x=c(7,10,10,7,7),y=c(2,2,8,8,2))
>>
>>
>> my.pol1.Sr <http://my.pol1.sr/> <- Polygons(list(Polygon(my.pol1)),
>> ID="1")
>> my.pol2.Sr <http://my.pol2.sr/> <- Polygons(list(Polygon(my.pol2)),
>> ID="2")
>> my.pol3.Sr <http://my.pol3.sr/> <- Polygons(list(Polygon(my.pol3)),
>> ID="3")
>>
>> my.pols.SpatPol.partial <- SpatialPolygons(list(my.pol1.Sr<http://my.pol1.sr/>
>> ,my.pol2.Sr <http://my.pol2.sr/>))
>>
>> my.pols.SpatPol.complete <- SpatialPolygons(list(my.pols.SpatPol.partial,
>> my.pol3.Sr <http://my.pol3.sr/>))
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> 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
>
>

	[[alternative HTML version deleted]]


