View source: R/marine_forecast.R
marine_forecast | R Documentation |
marine_forecast()
calls the Open-Meteo Marine Forecast API to obtain swell
and wave data for a given location. Limited historical data is also available
via this API.
Refer to the API documentation at: https://open-meteo.com/en/docs/marine-weather-api
marine_forecast(
location,
start = NULL,
end = NULL,
hourly = NULL,
daily = NULL,
response_units = NULL,
timezone = "auto"
)
location |
Required. The location for which data will be retrieved.
Supplied as either a |
start, end |
Start and end dates in ISO 8601 (e.g. "2020-12-31"). If no dates are supplied, data for the next 7 days will be provided by default. |
hourly, daily |
At least one required. A marine weather variable accepted by the API, or list thereof. See details below. |
response_units |
Supply to convert response units for wave heights. This
defaults to: |
timezone |
specify timezone for time data as a string, i.e.
"australia/sydney" (defaults to "auto", the timezone local to the specified
|
You will need to specify at least one variable to retrieve, such as wave height, that you want data for. These variables are sampled or aggregated at hourly or daily intervals, and can be supplied as a list to request multiple variables over the same time period.
Example Hourly variables include:
Variable | Description |
wave_height | Wave height of significant mean waves |
wind_wave_height | Wave height of significant wind waves |
swell_wave_height | Wave height of significant swell waves |
wind_wave_direction | Mean direction of wind waves |
swell_wave_period | Mean period between swell waves |
Example Daily variables include:
Variable | Description |
wave_height_max | Maximum wave height for mean waves |
wind_wave_direction_dominant | Dominant wave direction of wind waves |
swell_wave_period_max | Maximum wave period of swell waves |
Full documentation for the marine API is available at: https://open-meteo.com/en/docs/marine-weather-api
Requested marine conditions data for the given location and time, as a tidy tibble.
# Obtain maximum wave heights in Nazare, Portugal, over the next week
marine_forecast("Nazare", daily = "wave_height_max")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.