# Find names of relevant datasets ds <- grep(sprintf("^%s.", arguments$key), names(gis), ignore.case = TRUE, value = TRUE)
# Get previous track points points <- as_data_frame(gis[[ds[grep(sprintf("%s_pts", arguments$key), ds, ignore.case = TRUE)]]]) # Convert points$STORMTYPE to factor points$STORMTYPE <- factor(points$STORMTYPE, levels = c("DB", "LO", "TD", "TS", "HU", "MH"), labels = c("Disturbance", "Low", "Tropical Depression", "Tropical Storm", "Hurricane", "Major Hurricane")) plot_points <- geom_point(data = points, aes(x = LON, y = LAT, size = STORMTYPE))
# Get forecast track points fcst_points <- as_data_frame(gis[[ds[grep(sprintf("%s.+_5day_pts", arguments$key), ds, ignore.case = TRUE)]]]) # Convert points$STORMTYPE to factor fcst_points$STORMTYPE <- factor(fcst_points$STORMTYPE, levels = c("DB", "LO", "TD", "TS", "HU", "MH"), labels = c("Disturbance", "Low", "Tropical Depression", "Tropical Storm", "Hurricane", "Major Hurricane")) plot_fcst_points <- geom_point(data = fcst_points, aes(x = LON, y = LAT, size = STORMTYPE))
tracking_chart(color = "black", fill = "white", size = 0.1, res = 50) + plot_points + plot_fcst_points + theme(legend.position = "bottom", legend.box = "vertical")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.