team_7: Team 7

Description Usage Arguments Details Value Examples

Description

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.

Usage

1
team_7(file, tolerance = 0.1)

Arguments

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.

Details

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

Value

A dataframe created from the shape file.

Examples

 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()

yaweige/lab3group3 documentation built on May 28, 2019, 12:23 p.m.