Tutorial

The following tutorial will walk you through how to use the package week4

# Import library
library(week4)
library(dplyr)
library(maps)
# Use make_filename to create a valid file name
make_filename(2014)

# Use fars_read to read the file. Make sure the data files are in the working directory
list.files()
fars_read(filename = make_filename(year = 2014))

# Use fars_read_years get a list of years each being a tibble showing all records for each year
fars_read_years(years = c(2013, 2014))

# Use fars_summarize_years to summarise the record counts of each month and each year
fars_summarize_years(years = c(2014, 2015))

# Use fars_map_state to make a plot of the instances of accidents in a particular state
fars_map_state(state.num = 1, year = 2013)


ZhangHaoquan/BuildingAnRPackage documentation built on May 8, 2019, 9:46 a.m.