fars_map_state: This is a function that plots the LONGITUD and LATITUDE of...

Description Usage Arguments Value Examples

View source: R/fars_functions.R

Description

The function "filter" is imported from external package "dplyr". The function "map" is imported from external package "maps".

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

A number giving the id of a state. This function reads in state.num and year. In the file read accordin to the year, there may not be matched state.num, and this case the function stops and prints "invalid STATE number: ", state.num). The filtered data according to state.num and year may not exist, and in this case it prints a warning message "no accidents to plot" and return a NULL object.

year

A number giving the year

Value

This function plots the LONGITUD and LATITUDE of the selected states on a map.

Examples

1
2
3
WD <- setwd(system.file("extdata", package = "mypack"))
fars_map_state(12, 2015)
setwd(WD)

mtp22peng/mypack documentation built on May 17, 2019, 12:15 p.m.