Re: [R-sig-Geo] [FORGED] Re: Problems with rbind(list(), makeUniqueIDs=T)

2016-07-22 Thread Rolf Turner
On 23/07/16 15:00, Bacou, Melanie wrote: Thanks! I wonder why the original syntax passing a list used to work (I believe). For a much longer (and unknown) list of SpatialPolygonsDataFrames could an approach using do.call() work instead? I tried but: > m <- do.call(rbind, m, makeUniqueIDs=T)

Re: [R-sig-Geo] Problems with rbind(list(), makeUniqueIDs=T)

2016-07-22 Thread Bacou, Melanie
Thanks! I wonder why the original syntax passing a list used to work (I believe). For a much longer (and unknown) list of SpatialPolygonsDataFrames could an approach using do.call() work instead? I tried but: > m <- do.call(rbind, m, makeUniqueIDs=T) Error in do.call(rbind, m, makeUniqueIDs =

Re: [R-sig-Geo] Problems with rbind(list(), makeUniqueIDs=T)

2016-07-22 Thread Edzer Pebesma
The correct call to rbind would be mm = rbind(m[[1]], m[[2]], m[[3]], makeUniqueIDs=T) with sp on CRAN this doesn't work; with the version on github it does. An alternative with sp from CRAN is to make the IDs unique by hand: spChFIDs(m[[1]]) <- paste0("A", seq(length(m[[1]])))

Re: [R-sig-Geo] Problems with rbind(list(), makeUniqueIDs=T)

2016-07-22 Thread chris english
Mel, > m <- lapply(c("TZA", "UGA", "GHA"), function(x) getData("GADM", country=x, level=1)) I get: (after GDAM downloads) trying URL 'http://biogeo.ucdavis.edu/data/gadm2.8/rds/TZA_adm1.rds' Content type 'unknown' length 1152781 bytes (1.1 MB) ==

[R-sig-Geo] Problems with rbind(list(), makeUniqueIDs=T)

2016-07-22 Thread Bacou, Melanie
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. >

Re: [R-sig-Geo] Aggregate data to lower resolution

2016-07-22 Thread Miluji Sb
Dear Loic, Thank you for your reply. When I run this code on the whole data set (that has all the countries in the world) - I get mostly NAs. The attributes are: class : RasterLayer dimensions : 135, 359, 48465 (nrow, ncol, ncell) resolution : 1, 1 (x, y) extent : -178.5, 180.5,