Learn R Programming

stormwindmodel (version 0.1.4)

create_full_track: Impute hurricane tracks to finer time scale

Description

Inputs data on a hurricane's track and imputes to a finer time resolution. For example, if the hurricane tracks are recorded at 6-hour intervals, this could be used to impute locations and windspeeds at 15-minute intervals. This function also does some reformatting necessary for later functions in the stormwindmodel package.

Usage

create_full_track(hurr_track = stormwindmodel::floyd_tracks, tint = 0.25)

Arguments

hurr_track

Dataframe with hurricane track data for a single storm. The dataframe must include columns for date-time (year, month, day, hour, minute; e.g., "198808051800" for August 5, 1988, 18:00 UTC), latitude, longitude, and wind speed (in knots). The column names for each of these must be date, latitude, longitude, and wind. See the example floyd_tracks dataset for an example of the required format.

tint

Interval (in hours) to which to interpolate the tracks. The default is 0.25 (i.e., 15 minutes).

Value

A version of the storm's track data with latitude, longitude, and wind speed interpolated between observed values. Also, wind speed is converted in this function to m / s and the absolute value of the latitude is taken (necessary for further wind speed calculations). Finally, the names of some columns are changed (tclat for latitude, tclon for longitude, and vmax for wind speed.)

Details

The function uses natural cubic splines for interpolation for location and linear splines for interpolation for wind speed. The base R functions spline and approx are used for these interpolations.

Examples

Run this code
# NOT RUN {
data("floyd_tracks")
full_track <- create_full_track(hurr_track = floyd_tracks)

# Interpolate to every half hour (instead of default 15 minutes)
full_track <- create_full_track(hurr_track = floyd_tracks, tint = 0.5)

# }

Run the code above in your browser using DataLab