[R-sig-Geo] rbind of SpPolDFs

Agustin Lobo alobolistas at gmail.com
Tue May 18 18:45:26 CEST 2010


Thanks. I have to do it this way as the tables are inconsistent:

BesosBoundary at data <- data.frame(Basin="Besos")
TerBoundary at data <- data.frame(Basin="Ter")
BesosBoundary <- spChFIDs(BesosBoundary, "Besos")
TerBoundary <- spChFIDs(TerBoundary, "Ter")
delme <- rbind.SpatialPolygonsDataFrame(BesosBoundary,TerBoundary)

Nevertheless, as I have several of these shape files, I'm trying a loop.
But while the following works:
> i <- 1
> basnom <- unlist(strsplit(bas[i], "Boundary"))
> basnom
[1] "Besos"

> slot(BesosBoundary,"data") <- data.frame(Basin = basnom)

the following (which I need for using the names in an array) does not:
> bas[i]
[1] "BesosBoundary"

> slot(get(bas[i]),"data") <- data.frame(Basin = basnom)
Error in slot(get(bas[i]), "data") <- data.frame(Basin = basnom) :
  could not find function "get<-"

am I doing something wrong or have I hitted an inconsistency?

Agus 
-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/rbind-of-SpPolDFs-tp5070215p5070943.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list