Description Usage Arguments Value Examples
Generating dataframes from shapefiles for smooth maps
1 |
file |
A path to a shape file |
tolerance |
A numeric value specifying the default value at which to thin the polygon. Generally less than 0.1 |
A dataframe with lat and long coordinates to plot a map
1 2 3 4 5 6 7 | filename <- system.file("extdata", "gadm36_PAN_1.shp", package = "smoothMap")
dat <- team_4(filename, tolerance = 0.01)
if (require(ggplot2))
ggplot(dat, aes(x = long, y = lat, group = group)) +
geom_polygon(color = "black", fill = "white", size = 0.2) +
labs(x = "Longitude", y = "Latitude", title = "Panama") +
coord_fixed()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.