Interpolate and add weather data to a dataframeSource:
When data and the weather measurements do not perfectly line up, perform a
linear interpolation between two weather measurements and merge the results
into the provided dataset. Only applies to numerical weather columns (see
weather for more details).
Dataframe. Data with dates or times to which weather data should be added.
Dataframe. Weather data downloaded with
weatherwhich should be interpolated and added to
Character. Vector containing the weather columns to add or 'all' for all relevant columns. Note that some measure are omitted because they cannot be linearly interpolated (e.g., wind direction).
What interval is the weather data recorded at? "hour" or "day".
How many hours or days (depending on the interval) is it acceptable to skip over when interpolating over NAs (see details).
Logical. Suppress all messages (including messages regarding missing data, etc.)
Dealing with NA values If there are NAs in the weather data,
na_gap can be used to specify a tolerance. For example, a tolerance of
2 with an interval of "hour", means that a two hour gap in data can be
interpolated over (i.e. if you have data for 9AM and 11AM, but not 10AM, the
data between 9AM and 11AM will be interpolated. If, however, you have 9AM and
12PM, but not 10AM or 11AM, no interpolation will happen and data between 9AM
and 12PM will be returned as NA.)