fars_map_state: Function fars_map_state reads in fars data for one state and...

View source: R/fars_functions.R

fars_map_stateR Documentation

Function fars_map_state reads in fars data for one state and displays number of occurences on the map

Description

This function uses two previusly defined functions: make_filename (for creating a name of imported file) and make_filename (for loading csv file from file). In the secund step it verifies if the state.number is in the unique list of states. In case that number is not correct, than execution of function is stoped. Next step is to filter tibble by selected state. Secund check is done in order to verify if there are any accidents in mentioned state. Final step of function is to plot number of accindents on the map by lattitude and longitude

Usage

fars_map_state(state.num, year)

Arguments

state.num

Unique identifier of state

year

Single year that will be analyzed in map

Value

This function will return map of selected state with number of occurences by GPS cordinates with lattitude and longitude.


BendaVladimir/RPackagesWeek4 documentation built on May 9, 2022, 8:31 p.m.