Description Usage Arguments Value Examples
This function takes shapefiles with a population field and first converts the maps to a hexagonal grid, and then weights areas with higher populations to appear larger
1 2 |
shp |
The spatial object to be read in, providing the coordinates and the dbf |
pop_field |
The name of the population field within the data set that will later be transformed to provide the weights |
choro_field |
The name of the optional field with the values that will later go onto provide the values for the choropleth map |
colval |
The name of the optional field that if true, will provide colors by polygon for the map. Note that if this field and the choro/jenks fields are empty, then the map will be made blue. The colval field should take the form of a value that can be recognized as as color (i.e. blue). Can also be manipulated before hand by the user so that it reflects some non-jenks categorization of values. |
label_field |
The name of the field with polygon labels, which if filled, will overlay the polygons with names. |
quant_carto_breaks |
The True/False field as to how the user wants the population weights. If true, then the weights will be transformed such that the weights will be broken by the values quantile (i.e. pops in fifth pct will have size weight of 0.05). False, and the values will be the normalized population values, which might result in oddities if the population is not normally distributed. |
The dataframe and plot of the map will be provided, with the following fields:
xcor = The x coordinate for the centroid of the hexagon
ycor = The y coordinate for the centroid of the hexagon
pop_field = The populations of the polygonal units provided
color_field = The color values for the polygon
norm_pop = The normalized population values on a 0 - 1 scale
label = If user provided, the labels of the polygons
norm_pop2 = The quantile apportioned weights for the map
1 2 | mi_shp <- readOGR(eguia_path, "mi_county_shp")
test_hexagon <- hexcarto2b(mi_shp,pop_field="VAP2010",choro_field="gop_vote_s",jenks = TRUE,quant_carto_breaks = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.