Learn R Programming

stormwindmodel (version 0.1.4)

add_storm_track: Plot Atlantic basin hurricane tracks

Description

Plot the tracks of a selected tropical storm to a map of modeled wind speed.

Usage

add_storm_track(
  storm_tracks,
  plot_object,
  plot_points = FALSE,
  alpha = 1,
  color = "firebrick"
)

Arguments

storm_tracks

A data frame with best tracks data for the storm track you would like to add. See the example floyd_tracks data for an example of the required format. This dataset must include columns for date (date-time of the track observation), latitude, and longitude.

plot_object

NULL or the name of a ggplot object to use as the underlying plot object (e.g., the output from a call to map_wind)

plot_points

TRUE / FALSE indicator of whether to include points, as well as lines, when plotting the hurricane tracks.

alpha

Numerical value designating the amount of transparency to use for plotting tracks.

color

Character string giving the color to use to plot the tracks.

Value

A ggplot object that includes a line with the track of a given tropical storm. This object can be printed directly or added on to with other ggplot commands.

Examples

Run this code
# NOT RUN {
library(ggplot2)
data("county_points")
data("floyd_tracks")
grid_winds_floyd <- get_grid_winds(hurr_track = floyd_tracks,
                                   grid_df = county_points)
floyd_map <- map_wind(grid_winds_floyd, value = "vmax_sust",
                      wind_metric = "knots") +
             ggtitle("Maximum sustained wind speeds")
add_storm_track(floyd_tracks, plot_object = floyd_map)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab