powered by
Creates a map with optional graph overlay
redist.map( shp = NULL, district_membership = NULL, centroids = TRUE, edges = TRUE, drop = FALSE, title = "" )
A SpatialPolygonsDataFrame or sf object. Required.
A numeric vector with one row for each precinct in shp. Used to color the districts. Default is NULL. Optional.
NULL
A logical indicating if centroids should be plotted. Default is TRUE.
TRUE
A logical indicating if edges should connect adjacent centroids. Default is TRUE.
A logical indicating if edges that cross districts should be dropped. Default is FALSE.
FALSE
A string title of plot. Defaults to empty string. Optional.
ggplot map
# NOT RUN { library(redist) data("fl25") data("algdat.p10") cds <- algdat.p10$cdmat[,100] redist.map(shp = fl25, district_membership = cds) # } # NOT RUN { # }
Run the code above in your browser using DataLab