Learn R Programming

openmeteo (version 0.2.4)

marine_forecast: Retrieve marine conditions data from the Open-Meteo API

Description

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

Usage

marine_forecast(
  location,
  start = NULL,
  end = NULL,
  hourly = NULL,
  daily = NULL,
  response_units = NULL,
  timezone = "auto"
)

Value

Requested marine conditions data for the given location and time, as a tidy tibble.

Arguments

location

Required. The location for which data will be retrieved. Supplied as either a c(latitude,longitude) WGS84 coordinate pair or a place name string (with co-ordinates obtained via geocode()).

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: list(length_unit="metric") for meters. Specify "Imperial" for feet.

timezone

specify timezone for time data as a string, i.e. "australia/sydney" (defaults to "auto", the timezone local to the specified location).

Details

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:

VariableDescription
wave_heightWave height of significant mean waves
wind_wave_heightWave height of significant wind waves
swell_wave_heightWave height of significant swell waves
wind_wave_directionMean direction of wind waves
swell_wave_periodMean period between swell waves

Example Daily variables include:

VariableDescription
wave_height_maxMaximum wave height for mean waves
wind_wave_direction_dominantDominant wave direction of wind waves
swell_wave_period_maxMaximum wave period of swell waves

Full documentation for the marine API is available at: https://open-meteo.com/en/docs/marine-weather-api

Examples

Run this code
# \donttest{
# Obtain maximum wave heights in Nazare, Portugal, over the next week
marine_forecast("Nazare", daily = "wave_height_max")
# }

Run the code above in your browser using DataLab