fars_map_state: Print "FARS Accident Data Mapping State-wise"

Description Usage Arguments Value Note

View source: R/fars_functions.R View source: R/fars_functions.R

Description

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.

Usage

1
fars_map_state(state.num, year)

Arguments

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.

Value

This function returns a graphical plot of accidents occurring in the specified State during the year mentioned.

Note

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.


Urmimala-Nath/courseraAccFARS documentation built on July 30, 2020, 4:28 a.m.