Description Usage Arguments Value Examples
View source: R/geom_hurricane.R
This function return a Grob object to be displayed. The image will characterize a hurricane depited by the edges of each circle's quadrant (possibly representing wind_raius), and the color of the circles (possibly depicting wind_speeds).
1 2 3 |
data |
A Dataframe Object containing the data to plot. |
x |
Column of ‘data' depicting the x-locations of the Storm’s Center (LONGITUDE for maps). |
y |
Column of ‘data' depicting the y-locations of the Storm’s Center (LATITUDE for maps). |
r_ne |
Column of 'data' depicting the wind_raius of the North East Quadrant. |
r_se |
Column of 'data' depicting the wind_raius of the South East Quadrant. |
r_nw |
Column of 'data' depicting the wind_raius of the North West Quadrant. |
r_sw |
Column of 'data' depicting the wind_raius of the South West Quadrant. |
fill |
OPTIONAL. Column of 'data' which will be use to color the circles. |
color |
OPTIONAL. Column of 'data' which will be use to color the circle outlines. |
scale_radii |
OPTIONAL. Numeric. Size scale of the drawn Hurricane. |
This function adds the hurricane image (Grob) into the current graphics device.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
## Data
ext_tracks <- reading_tropical_cyclone(filename = "data/ebtrk_atlc_1988_2015.txt")
ext_tracks <- tc_geom_format(ext_tracks)
## STORMS
katrina <- ext_tracks %>%
dplyr::filter(storm_id == "KATRINA-2005", date == "2005-08-29 12:00:00") %>%
dplyr::mutate(longitude = longitude * -1) %>%
as.data.frame()
## Maps
ggmap::get_map("Louisiana", zoom = 6, maptype = "toner-background") %>%
ggmap::ggmap(extent = "device") +
geom_hurricane(data = katrina,
aes(x = longitude, y = latitude,
r_ne = ne, r_se = se, r_nw = nw, r_sw = sw,
fill = wind_speed, color = wind_speed)) +
ggplot2::scale_color_manual(name = "Wind speed (kts)",
values = c("red", "orange", "yellow")) +
ggplot2::scale_fill_manual(name = "Wind speed (kts)",
values = c("red", "orange", "yellow"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.