knitr::opts_chunk$set(echo = TRUE)
For Hurricane Ike
library(dplyr) library(ggmap) library(buildnewgeomwk4) library(gridExtra) library(lubridate) ext_tracks<-read_ext_tracks(file="ebtrk_atlc_1988_2015.txt") tidy_ext_tracks<-tidy_tracks(ext_tracks=ext_tracks) h_name <- "IKE" h_time <- lubridate::ymd_h("2008 09 12 12") storm_observation<-filter_(tidy_ext_tracks, ~storm_name %in% h_name, ~date %in% h_time) loc<-unique(c(storm_observation$longitude,storm_observation$latitude)) Normal<-get_map(location=loc, zoom =6 , maptype = "toner-background") %>% ggmap(extent = "device")+geom_hurricane(data=storm_observation, mapping=aes(x=longitude,y=latitude, r=wind_radius, wind_speed=wind_speed, quadrant=quadrant, fill=as.factor(wind_speed), color=as.factor(wind_speed)))+ scale_color_manual(name = "Wind speed (kts)", values = c("red", "orange", "yellow")) + scale_fill_manual(name = "Wind speed (kts)", values = c("red", "orange", "yellow"))+ ggtitle("scale_radii=1.00") Half<-get_map(location=loc, zoom =6 , maptype = "toner-background") %>% ggmap(extent = "device")+geom_hurricane(data=storm_observation, mapping=aes(x=longitude,y=latitude, r=wind_radius, wind_speed=wind_speed, quadrant=quadrant, fill=as.factor(wind_speed), color=as.factor(wind_speed), scale_radii=0.5))+ scale_color_manual(name = "Wind speed (kts)", values = c("red", "orange", "yellow")) + scale_fill_manual(name = "Wind speed (kts)", values = c("red", "orange", "yellow")) + ggtitle("scale_radii = 50%") gridExtra::grid.arrange(Normal,Half,ncol=2,nrow=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.