team_2: Generating dataframes from shapefiles for smooth maps

Description Usage Arguments Value Author(s) Examples

Description

Generating dataframes from shapefiles for smooth maps

Usage

1
team_2(file, tolerance)

Arguments

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

Value

A dataframe with lat and long coordinates to plot a map

Author(s)

Xiyuan Sun ,xiyuansu@iastate.edu

Examples

1
2
3
4
5
6
7
filename <- system.file("extdata", "gadm36_CUB_1.shp", package = "smoothMap")
dat <- team_2(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 = "Cuba") +
    coord_fixed()

lydiaPenglish/smoothMap documentation built on May 9, 2019, 1:10 a.m.