fars_map_state: Generates a map displaying accidents for a given state and...

Description Usage Arguments Details Value Examples

Description

This is a function that generates a map (using the maps package) that displays the location of accidents (using the graphics package) for a given state and year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

integer

year

integer

Details

Will generate error if an invalid state number is input.

Value

This function returns a graphical object.

Examples

1
2
3
4
5
6
7
8
library(dplyr)
library(readr)
library(tidyr)
library(maps)
library(graphics)
f14path <- system.file("extdata", "accident_2014.csv.bz2", package = "farsfuncs")
file.copy(from=c(f14path),to=getwd())
fars_map_state(1,2014)

sophiasagan/farsfunc2 documentation built on May 26, 2019, 5:44 p.m.