Description Usage Arguments Examples
This function takes in a dataframe, shapefile path, and variable and outputs a .png file
1 2 3 4 5 |
data |
Dataframe with the data you want to plot. Must have two columns with the first column called "id" matching up with the "id" column in the map dataframe. |
map |
Dataframe with shapefile data (after using fortify()). |
palette |
Color Brewer palette to use (http://colorbrewer2.org/). |
title |
String with title of the map, defaults to blank. |
fill_label |
String with a label for a legend, defaults to blank. |
output |
String with output filename, defaults to "out.png". |
width |
Defaults to 7. |
height |
Defaults to 7. |
per |
TRUE if labels are a percentage (0.2 -> 20%), defaults to FALSE. |
reverse_colors |
TRUE if you want to reverse the colors on the legend, defaults to FALSE. |
reverse_legend |
TRUE if you want to reverse the legend, defaults to TRUE. |
projection |
Method of projection, takes in Mercator or Albers. |
proj_args |
Any arguments necessary for the projection method (Albers requires lat0 and lat1 arguments). |
border |
Optional parameter if you want different borders (i.e. census tract data with county borders). |
border_color |
Color of the borders, defaults to black. |
size |
Size of the borders, defaults to 0.25. |
1 | makemap(data=d, map = map)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.