[R-sig-Geo] Problems with rbind(list(), makeUniqueIDs=T)
Bacou, Melanie
mel at mbacou.com
Fri Jul 22 22:55:23 CEST 2016
Hi,
I'm getting weird results trying to rbind a list of
SpatialPolygonsDataFrames with R 3.2.1 and raster 2.5.8. I believe the
code below used to merge all 3 country boundaries, but instead I now get
a list with 6 elements (incl. 3 logical TRUE). Am I doing something wrong?
Thx, --Mel.
> library(raster)
> m <- lapply(c("TZA", "UGA", "GHA"), function(x) getData("GADM",
country=x, level=1))
> m <- rbind(m, makeUniqueIDs=T)
> sapply(m, class)
[1] "SpatialPolygonsDataFrame" "logical" "SpatialPolygonsDataFrame"
[4] "logical" "SpatialPolygonsDataFrame" "logical"
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] raster_2.5-8 sp_1.2-3 rj_2.0.5-2
loaded via a namespace (and not attached):
[1] rj.gd_2.0.0-1 Rcpp_0.12.6 grid_3.2.1 lattice_0.20-33
--
Melanie BACOU
International Food Policy Research Institute
Snr. Program Manager, Spatial Data and Analytics
Work +1(202)862-5699
E-mail m.bacou at cgiar.org
Visit www.harvestchoice.org
More information about the R-sig-Geo
mailing list