mapmerge {eeptools}R Documentation

A depcrecated method for converting polygons to dataframes Combine an S4 polygon object with a dataframe

Description

Convenience function for merging dataframes and S4 spatial polygon objects.

Usage

mapmerge(mapobj, data, xid, yid)

Arguments

mapobj

Name of an S4 SpatialPolygonsDataFrame

data

Name of a dataframe

xid

Name of ID variable in the SpatialPolygonsDataFrame

yid

Name of ID variable in the dataframe

Value

A SpatialPolygonsDataFrame with new variables attached from supplied dataframe

Examples

## Not run: 
xx <- maptools::readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], IDvar="FIPSNO")
yy <- as(xx,"data.frame")
yy$newvar <- sample(letters, nrow(yy), replace=TRUE)
yy <- subset(yy, select=c("FIPS", "newvar"))
newpoly <- mapmerge(xx, yy, xid="FIPS", yid="FIPS")

## End(Not run)

[Package eeptools version 1.2.4 Index]