fars_map_state: Map accidents

Description Usage Arguments Details Value Examples

Description

Plot the point map for the fars record of the STATE corresponding to the state.num and the year provided

Usage

1
fars_map_state(state.num, year, path = ".")

Arguments

state.num

(num) An integer (or something cohercible to it) representing a STATE number into the fars data.

year

(num) The year of the interested fars file.

path

(chr) path to the fars file

Details

if no accident happen in the state and period selected a message will be throw and NULL is returned.

If a plot is returned, it will be drawn only for longitude not greater than 900 and latidude not grater than 90.

Value

NULL (with a message) if the STATE represented by the state.num provided has no records in fars for the year selected. Otherwhise, a plot with the geographical point for its fars is produced and nothing will be returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
    file_path <- system.file("tests", "testthat",
        package = "weektwo"
    )

    fars_map_state(1, 2013, path = file_path)
    fars_map_state(1, 2012, path = file_path) # error
    fars_map_state(2, 2015, path = file_path) # nothing to drawn

## End(Not run)

CorradoLanera/weektwo documentation built on May 8, 2019, 12:51 p.m.