Description Usage Arguments Value Examples
This function maps locations of accidents occured in each state of a specific
year. It provides messages if the state number is invalid or when there are no
accidents to plot in a state of a given year. Before creating a map for a state
all the missing observations involving Latitude and Longitude are removed from
the dataset.This function uses (filter(data, state.num)
) from dplyr
package, and two other functions, one is (map(state, ylim, xlim)
) from
maps
package, and the other (points(LONGITUD,LATITUD,pch)
) from
graphics
package.
1 | fars_map_state(state.num, year)
|
state.num |
A number representing a state that is converted as integer. |
year |
A four-digit number representing a specific year |
The function returns a state-specific map of a year, pointing fatal accident locations identified by dimensions of longitude and latitude.
1 2 3 4 | ## Not run:
fars_map_state(1,2013)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.