Thanks. I have to do it this way as the tables are inconsistent: besosbound...@data <- data.frame(Basin="Besos") terbound...@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. _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo