This is the vignette documentation for the Corusera Week 4 exercise.

Functions

fars_read

This function takes a path as a parameter reads the file into a data.frame object.\n

df<-CourseraWeek2::fars_read(CourseraWeek2::make_filename(2013))
head(df)

make_filename

This function takes an integer representing the year and returns a string formatted to match the filename of the file for that year.\n

CourseraWeek2::make_filename(2013)

fars_read_years

This function takes a list of years,and reads the data from the corresponding files into a single dataset.\n

df<-CourseraWeek2::fars_read_years(c(2013,2014))
head(df)

fars_summarize_years

This function takes a list of years as a parameter and uses it to build the filenames for those years based on the appropriate naming convetion to generate a dataframe of the years and months of each accident summarised by month with each year as a separate variable.\n

CourseraWeek2::fars_summarize_years(c(2013,2014))

fars_map_state

This function generates a map of the state with the location of the accidents. It uses parameters of state number and year.\n

 CourseraWeek2::fars_map_state(10,2014)

I would put a map here but the maps package is a bit dodgy. It will run OK in the RStudio, but crashes when you Knit. This is a documented error with no solution...but it made it to CRAN. (Probably with the dontrun option)



MaxSunshine/CourseraWeek2 documentation built on May 7, 2019, 4:35 p.m.