knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(assignment04)
This vignette shows how to plot a map for FARS occurrences using the
fars_map_state
function.
The first thing we need to do is make sure that our current working
directory has FARS data files named accident_{year}.csv.bz2
, where
{year}
is a 4 digit number, e.g. 2013
.
list.files(pattern = "accident_*.csv.bz2", recursive = FALSE)
Then, we simply need to call the fars_map_state
function with the
state and year we are interested in plotting.
fars_map_state(1, 2013)
And there we have it.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.