library(dplyr)
library(rrricanes)

General Introduction

rrricanes is intended to give easy access to hurricane archives. It is a web-scraping tool that parses the National Hurricane Center's (NHC) archives to get storm data. Data is available for storms dating back to 1998.

There are two basins which data is available: north Atlantic ("AL") and northeastern Pacific ("EP"). The northeastern Pacific basin typically covers from the west coast of North America to -140° longitude (140°W).

Get Storms

By default, get_storms will return all storms that have developed for the current year in both basins. If no storms have developed, an error will be generated. For this example, we'll use 2012.

df.al_2012 <- get_storms(years = 2012, basins = "AL")

Getting Storm Data

get_storm_data can be used to retrieve one or multiple products for one or more cyclones. A list of tibbles is returned.

df.al_18_2012 <- df.al_2012 |> 
    dplyr::filter(Name == "Hurricane Sandy") 

df.al_18_2012 <-
  get_storm_data(df.al_18_2012$Link,
                 products = "fstadv")

We can get the forecast/advisory data and wind speed probabilities at once:

df.al_18_2012 <- df.al_2012 |> 
    filter(Name == "Hurricane Sandy") 

v.al_18_2012 <- df.al_18_2012 |> dplyr::pull(Link)

df.al_18_2012 <- get_storm_data(v.al_18_2012, c("fstadv", "wndprb"))

storm.al_18_2012 now contains two tibbles for Hurricane Sandy; fstadv and wndprb.

Forecast/Advisory Product (fstadv)

The core of a storm's dataset is located in the Forecast/Advisory product, fstadv. This product contains current location, forecast position, movement and structural details of the cyclone.

To access only this product, we can use get_fstadv:

df.al_18_2012 <- df.al_2012 |> 
    dplyr::filter(Name == "Hurricane Sandy") 


df.al_18_2012_fstadv  <-
          get_fstadv(v.al_18_2012) 
df.al_18_2012_wndprb  <-
          get_wndprb(v.al_18_2012) 

As you may have noticed above, the dataframe is very wide at 149 variables. There are four groups of variables in this dataset: current details, current wind radii, forecast positions, and forecast wind radii.

Current Details

Let's look at an example of the current details.

#str(df.al_18_2012_fstadv %>% select(Status:Eye, SeasNE:SeasNW))

The most important variable in this dataset is StormKey. StormKey is a unique identifier for each storm that develops in either basin. It is formatted such as "AABBCCCC" where "AA" is the basin abbreviation (AL or EP), "BB" is the year number of the storm left-padded, and "CC" is the year of the storm.

Adv is the second-most important variable here. You'll notice it is in character format. For regularly-scheduled advisories, advisory numbers are always numeric. However, when watches and warnings are in effect, intermediate advisories are issued which are given alpha suffixes; i.e., 1, 2, 3, 3A, 4, 4A, 4B, 5, etc.

Only the Public Advisory (public) will be issued more frequently. All other regular products (discus, fstadv, prblty, wndprb) are generally issued every six hours.

Status lists the current designation of the cyclone, i.e., Tropical Depression, Tropical Storm, etc. A Name is given once a storm crosses the threshold of Tropical Storm; that is, winds greater than 33kts.

Lat and Lon are the current position of the storm within PosAcc nautical miles. All distance measurements are in nautical miles.

Wind and Gust are current one-minute sustained wind speeds in knots (kts). You can use the function knots_to_mph to convert this. All wind speed values are in knots.

Pressure is the lowest atmospheric pressure of the cyclone either measured or estimated. It's value is in millibars but you can use mb_to_in() to convert to inches.

FwdDir and FwdSpeed show the compass direction of the forward movement of the cyclone. NA values indicate the storm is stationary or drifting. FwdSpeed is measured in knots.

In some cases, where hurricanes have an identifiable Eye, it's diameter in nautical miles will also be listed.

Lastly, the Seas variables will exist for a storm of at least tropical storm-strength. This is the distance from the center of circulation that 12ft seas can be found in each quadrant. The measurement is in nautical miles.

Helper function tidy_adv will subset this data to a narrow dataframe.

tidy_adv(df.al_18_2012_fstadv)

Wind Radius

Any cyclone of at least tropical storm-strength will have associated wind radius values. This is the distance from the center of circulation that a specified wind speed (34kts, 50kts, 64kts) can be found in each quadrant. Measurement is in nautical miles.

str(df.al_18_2012_fstadv %>% select(NE64:NW34))

A helper function, tidy_wr will reorganize this data into a narrow format and tidied up. Complete wind radius values that are NA are removed for efficiency.

tidy_wr(df.al_18_2012_fstadv)

Forecast

Most Forecast/Advisory products will have forecast data associated with it unless the storm has dissipated or is no longer tropical. There may be up to seven forecast positions. These positions are issued by 12-hour intervals through 48 hours where they are then at 24-hour intervals; 12, 24, 36, 48, 72, 96 and 120 hours.

str(df.al_18_2012_fstadv |> select(Hr12FcstDate:Hr12Gust))

Notice each variable begins with the prefix "Hrn" where n is the forecast period as noted above. Only Date, Lat, Lon, Wind, Gust and wind radius (will discuss shortly) are given for forecast periods.

Use tidy_fcst to tidy forecast data.

tidy_fcst(df.al_18_2012_fstadv)

Forecast Dates/Times

A note about forecast times.

df.al_18_2012_fstadv %>% select(Date, Hr12FcstDate) %>% slice(1)

Notice the Date of this advisory is Oct 22 at 15:00 UTC. The Hr12FcstDate is Oct 23, 00:00 UTC. This difference, obviously, is not 12 hours. What gives? Forecast/Advisory products are issued with two "current" positions: one that is current (and provided in the dataset) and a position from three hours prior. So, in this specific advisory the text would contain the position of the storm for Oct 22, 12:00 UTC. It is from this position the forecast points are based. I do not know why.

Therefore, while officially the forecast periods are 12, 24, 36, ... hours, in reality they are 9, 21, 33, ... hours from the issuance time of the product.

Forecast Wind Radius

Some forecast positions may also contain wind radius information (only up to 72 hours).

str(df.al_18_2012_fstadv |> select(Hr12NE64:Hr12NW34))

Again, these variables are prepended with the prefix prefix "Hrn" where n notes the forecast period.

tidy_fcst_wr will tidy this subset of data.

tidy_fcst_wr(df.al_18_2012_fstadv)

Please see the National Hurricane Center's website for more information on understanding the Forecast/Advisory product.

Strike Probabilities (prblty)

Strike probabilities were discontinued after the 2005 hurricane season (replaced by Wind Speed Probabilities; wndprb). For this example, we'll look at Hurricane Katrina. For this we use the function get_prblty.

df.al_12_2005_prblty <- get_storms(year = 2005, basin = "AL") %>% 
    dplyr::filter(Name == "Hurricane Katrina") %>% 
    select(Link) %>% 
    get_prblty()
str(df.al_12_2005_prblty)

This dataframe contains the possibility of a cyclone passing within 65 nautical miles of Location. The variables A, B, C, D, and E are as they appear in the products and were left as-is to avoid confusion. They're definition is as follows:

Many values in the text product may be "X" for less than 1% chance of a strike. These values are converted to 0 as the fields are numeric.

The strike probability products did not contain StormKey which is the unique identifier for every cyclone. So the best way to do any joins will be by Name, Adv and Date.

Strike Probabilities may not exist for most Pacific cyclones.

Wind Speed Probabilities (wndprb)

df.al_18_2012_wndprb <- df.al_2012 |> 
    filter(Name == "Hurricane Sandy") |> 
    .$Link |> 
    get_wndprb()
str(df.al_18_2012_wndprb)

Wind Speed Probabilities are a bit more advanced than their predecessor. The Wind variable is for 34kt, 50kt and 64kt winds expected within a specific time period.

Each consecutive variable is within a specific time-frame (12, 24, 36, 48, 72, 96 and 120 hours) for both that time frame and cumulative.

For example, Wind24 is the chance of Wind between 12-24 hours. Wind24Cum is the cumulative probability from Date through 24 hours.

As with strike probabilities, an "X" in the original text product meant less than 0.5% chance for the specified wind in the specified time period. "X" has been replaced by 0 in this package.

Wind Speed Probabilities may not exist for most Pacific cyclones.

See Tropical Cyclone Wind Speed Probabilities Products for more information.

Other products

Other products are available:

Hurricane Ike, 2008, has both updates and position estimates.

At this time none of these products are parsed. Only the content of the product is returned.



timtrice/Hurricanes documentation built on Oct. 10, 2023, 8:15 p.m.