Converts the geometry section of a shape file to latitude-longitude format

team_10(file, tolerance = 0.1)

Arguments

file

File path of a geometry file, extension should be .shp.

tolerance

Tolerance level for thinning shape file. A percentage between 0 and 1.

Value

A data frame object

Details

The variables included in the dataframe that is returned from team_10 are as follows.

  • name = subregion name depicted by the data

  • region = coded subregion

  • group = indicates which polygon a set of points corresponds to

  • long = longitude of the point

  • lat = latitude of the point

Examples

gdat_path=system.file("extdata", "gadm36_AUS_1.shp", package = "lab3team12") tmp=team_10(gdat_path,0.1) library(ggplot2) library(dplyr)
#> #> Attaching package: ‘dplyr’
#> The following object is masked from ‘package:testthat’: #> #> matches
#> The following objects are masked from ‘package:stats’: #> #> filter, lag
#> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union
tmp %>% ggplot(aes(x=long,y=lat,group=group))+geom_polygon()