Description Usage Arguments Value Note
View source: R/fars_functions.R View source: R/fars_functions.R
This is a simple function which reads a State Number and a Year, and graphically plots the number of accidents that occurred within the specific geography and timeframe.
1 | fars_map_state(state.num, year)
|
state.num |
The function argument which stores a user-input State Number as an integer. |
year |
The function argument which stores a year specified by the user (integer datatype). |
filename |
Stores the name of file corresponding to the year entered as a string. |
data |
Stores the information in file specified by "filename" as Dataframe Table. |
data.sub |
Contains information filtered from the file based on the specified State Number as a list. |
This function returns a graphical plot of accidents occurring in the specified State during the year mentioned.
An error message will be displayed if an invalid State Number has been specified.
The user may customize this message inside "" of the stop
argument
If there is no data corresponding to a valid State Number, no graphs will be plotted.
The user may customize the corresponding message shown, inside "" of the message
argument
For any unavailable Latitude or Longitude values of that State, a "TRUE" or "FALSE" value is assigned accordingly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.