if (FALSE) {
if(require(sf)) {
xx <- as(st_read(system.file("shape/nc.shp", package="sf")[1]), "Spatial")
row.names(xx) <- as.character(xx$"FIPSNO")
row.names(as(xx, "data.frame"))
xx1 <- spChFIDs(xx, as.character(xx$CNTY_ID))
row.names(as(xx1, "data.frame"))
}}
Run the code above in your browser using DataLab