knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) datfolder <- system.file("extdata", package = "courseraFARS") file.copy( file.path(datfolder, dir(datfolder)), file.path(getwd(), dir(datfolder)) )
This package comes with a limited number of very basic functions. To demonstrate the use of these, the package comes with raw csv files which can be accessed with the following command:
datfolder <- system.file("extdata", package = "courseraFARS") dir(datfolder)
library(courseraFARS)
fars_read
loads the csv data into a tibble::tbl_df
(x <- fars_read(dir(datfolder)[1]))
fars_read_years
loads multiple csv files into a list of tibbles with only the MONTH
and year
columns.(x <- fars_read_years(2013:2015))
fars_summaize_years
returns tibble with counts for each month in the specified years(x <- fars_summarize_years(2013:2015))
fars_map_state
can be used for plotting the geographical coordinates of fatal injuries within a year for the specified state. fars_map_state(1, 2013)
file.remove(dir(datfolder)) rm(datfolder)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.