Description Usage Arguments Details Value Examples
This function was based on the work of team 7 in lab 2. From lab 2, this team convert a shp file from Austrailia to a data file. Our goal is to wrap the solution from this team into a function.
1 |
file |
This is a file path to a shape file. |
tolerance |
is the value used for thinning the polygon. The default of this value was set as 0.1. |
The variables included in the dataframe that is returned from team_5
are as follows.
A dataframe created from the shape file.
1 2 3 4 5 6 7 8 9 10 | # A shape file for Puerto Rico is already stored in the package
puerto_rico
# Use the team_7 function to convert the shape file to a dataframe
puerto_rico_df <- team_7(puerto_rico, 0.001)
head(puerto_rico_df)
# Create a plot of Puerto Rico using the dataframe
library(ggplot2)
ggplot(puerto_rico_df, aes(x = long, y = lat, group = group)) + geom_polygon()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.