This package provides two helper functions that provide summary and visualization on certain type of data files.
fars_read(filename)
- Read data from a csv filemake_filename()
- Generate a file name in a specific convensionfars_read_years()
- Read data from multiple csv filesfars_summarize_years()
- Count number of accidents happend in each month and yearfars_map_state()
- Plot the locations of accidents happend in a given state and yearIn order to execute the functions properly, data files need to be placed in the current working directory with a naming convension of accident_yyyy.csv.bz2
, where yyyy
indicates a year. Sample data files can be found in the pacakge's extdata
folder.
# Get specific columns from each data file fars_summarize_years(c(2013, 2014, 2015)) # Plot a map to show the location of accidents recorded in the data file fars_map_state(4, 2013)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.