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
slot(BesosBoundary,"data") <- data.frame(Basin = basnom)
the following (which I need for using the names in an array) does not:
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?