
Last chance! 50% off unlimited learning
Sale ends in
write.polylistShape(polylist, df, file, factor2char = TRUE,
strictFilename=FALSE, force = TRUE, max_nchar=254)
polylist
write.dbf
write.dbf
for details of the data frame export within this function.write.pointShape
, write.dbf
col_orig <- read.shape(system.file("shapes/columbus.shp", package="maptools")[1])
mappolys <- Map2poly(col_orig, as.character(col_orig$att.data$NEIGNO))
plot(mappolys)
col_df <- col_orig$att.data
col_cheap <- subset(mappolys, col_df$HOVAL < 34)
col_df_cheap <- subset(col_df, col_df$HOVAL < 34)
file <- tempfile("")
write.polylistShape(col_cheap, col_df_cheap, file)
getinfo.shape(paste(file, ".shp", sep=""))
col_new <- read.shape(paste(file, ".shp", sep=""))
mappolys <- Map2poly(col_new, as.character(col_new$att.data$NEIGNO))
plot(mappolys, border="red", add=TRUE)
Run the code above in your browser using DataLab