Description Usage Arguments Details Value Warning Note Examples
View source: R/fars_functions.R
fars_map_state takes a State number and a year as arguments.
Reads the corresponding file and draws a map of the acccidents using
longitude and latitude for that the state.
1 | fars_map_state(state.num, year)
|
state.num |
a state number, an integer between 1 and 56. |
year |
a year, as integer. |
If the value for the state.num parameter does not correspond to a
valid state in the dataset, the function will throw an error.
If the state and year combination has none observations, a message is
printed.
All the points outside of Longitude > 900 or Latitude > 90 are nullified and
not drawn on the map.
NULL (empty) returned invisibly invisible.
As side effect, the function will draw a map of accidents/observations.
maps package should be attached (library(maps)),
or the function will throw an error because maps does not export the data
(object 'stateMapEnv') for the map function.
The data files must be in the current working directory (see also
getwd) to be found.
1 2 | fars_map_state(1, 2013)
fars_map_state(48, 2015)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.