Description Usage Arguments Value Examples
This function attempts to output a polygon plot of a specific USA state with
points ("." by setting pch
to 46 in the points
function)
on the same plot indicating the location of all logged accidents within
a specified year. It automatically assigns NA
values to off-planet
LAT/LONG combinations with the base R function is.na
. The
values xlim
and ylim
of link{map}
is bound by the most
outlying LAT/LONG points found within the data and subsequently the polygon
drawn is clipped beyond these bounds.
1 | fars_map_state(state.num, year)
|
state.num |
A number coerced to integer correspnding to an USA state. |
year |
A number representing the data for a specific year. This cannot be a vector. (It can, but things go wrong.) |
A plot combining polygons and points.
If state.num
is not found within the dataset selected with
year
, no plot is created and an error is returned.
If the combination of state.num
and year
is valid, but there
are no accident data, the function returns NULL, but not made visible in
the console, while an appropriate message (not error) is displayed.
1 2 3 4 5 | ## Not run:
fars_map_state(1,2015)
fars_map_state(54,2015)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.