plot_map | R Documentation |
Plot a map of the data and include the outline of the desired states. In theory, the data can be mapped on any state within the United States using an variable in the data frame.
plot_map(
data,
states = "california",
yname = "total_catch_wt_kg",
ytitle = "weight (kg)",
yintercept = 34.5,
alpha = 0.5,
legend.position = c(0.9, 0.5)
)
data |
A data frame returned from nwfscSurvey::PullCatch.fn. |
states |
A single character value that will be used to search
for regions in maps::map. Regex is allowed, e.g.,
|
yname |
A single character value providing the name of the response variable to include in the figure. Only values great than zero will be included. |
ytitle |
A single character value used to label the legend for the y variable. |
yintercept |
A numeric value for ggplot2::geom_hline.
|
alpha |
Passed to ggplot2::geom_point to control the opacity of the points. |
legend.position |
A vector of two numeric values between zero and one that specify the relative location of the legend along the x and y axes. One can also use a single character value that is relevant to ggplot2::theme. |
A ggplot2::ggplot object.
Kelli F. Johnson
plot_map(
data =data.frame(
yy = 1:10,
Latitude_dd = 41:50,
Longitude_dd = rep(-121, 10)
),
yname = "yy",
states = "washington|oregon|california",
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.