Message-ID: <CANtt_hwb=-OSrBJcMtqY0p_5SWrb-bv9u1gHOhdJETX5jVGNQA@mail.gmail.com>
Date: 2016-04-04T16:04:10Z
From: Robert J. Hijmans
Subject: generating object with multiple polygons
In-Reply-To: <CAPU4_4piYEai_La9pJH84=90hhO=pV_-bQTPXmRczeC+fJeBHA@mail.gmail.com>
Karla,
You can do
library(raster)
slices <- bind(slice1, slice2)
Robert
On Sun, Apr 3, 2016 at 6:53 AM, Karla Shikev <karlashikev at gmail.com> wrote:
> Dear all,
>
> This might be a newbie question, so I'd appreciate your patience with this.
>
> I'm obtaining climatic data from worldclim and generating polygons based on
> different climatic limits:
>
> library(raster)
> xx<-getData('worldclim', var='bio', res=10)$bio1
> slice1 <- rasterToPolygons(xx, fun = function(x) {x > 200 & x < 260})
> slice2 <- rasterToPolygons(xx, fun = function(x) {x > 250 & x < 300})
>
> Now, I'd like to combine "slice1" and "slice2" into the same
> "SpatialPolygonsDataFrame" object, but I do not want to merge them.
>
> Any help will be greatly appreciated.
>
> Karla
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo