knitr::opts_chunk$set(echo = TRUE)

Runnig geom

For Hurricane Ike

```r 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))

Since july 2018, using ggmap will fail unless you use Google Maps API Key. You will need to give Google your billing information,

but you can create maps for free: more infos https://www.visibledata.co.uk/blog/2018/12/05/2018-12-05-using-ggmap-after-july-2018/

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)




Vaibhav291086/Vaibhav291086-Build-a-New-Geom documentation built on Dec. 18, 2021, 6:14 p.m.