fars_map_state: Read CSV, Filter state.num and Plot its Point Diagram

Description Usage Arguments Value Examples

View source: R/fars_functions.R

Description

The function first transfers the input 'year' into a character as "accident_'year'.csv.bz2" and read the file "accident_'year'.csv.bz2" as a tibble valued as 'data', then it also transfers the input state.num' as an integer. Moreover, if the field 'data$STATE' does not contain 'state.num', the function will stop and print a message. If data$STATE contains state.num but has nothing to plot, the function will print "no accidents to plot" and return invisible diagram; otherwise the function will plot a diagram with LONGITUD in x-asix and LATITUDE in y-asix with points to indicate the distrubution. You can input the year using state.num,year argument.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

the state number you want to filter in the data

year

the you want to process

Value

a graph with polts to show distrubitions in (LONGITUD,LATITUDE)

Examples

1
fars_map_state(42,2013)

askia318/CSVProcess documentation built on June 7, 2017, 11:52 a.m.