Created
November 17, 2012 23:18
-
-
Save dillonma/4101298 to your computer and use it in GitHub Desktop.
Use R with the foreign package to modify the DBF file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(foreign) | |
dbfdata <- read.dbf("file.dbf", as.is = TRUE) | |
## add new attribute data (just the numbers 1 to the number of objects) | |
dbfdata$new.att <- 1:nrow(shp) | |
## overwrite the file with this new copy | |
write.dbf(dbfdata, "file.dbf") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment