View source: R/get_metno_daily_forecast.R
| get_metno_daily_forecast | R Documentation |
Retrieves daily aggregated weather forecast data from the Norwegian Meteorological Institute
(MET.NO) locationforecast API. This is a convenience function that wraps get_metno_forecast
and aggregates the hourly forecast data into daily summaries.
get_metno_daily_forecast(
latitude,
longitude,
days = 9,
api_key,
timeout = 30,
max_retries = 3,
retry_delay = 1,
use_cache = TRUE,
cache_dir = NULL,
allow_stale_on_error = TRUE
)
latitude |
Numeric. The latitude in decimal degrees for the forecast location. Must be within Australian limits (-44 to -10). |
longitude |
Numeric. The longitude in decimal degrees for the forecast location. Must be within Australian limits (112 to 154). |
days |
Numeric. The number of forecast days to return (1-9, default: 9). |
api_key |
Character. Your email address, required for the User-Agent header as per MET Weather API terms of service. |
timeout |
Numeric. Request timeout in seconds (default: 30). |
max_retries |
Numeric. Maximum number of retry attempts for failed requests (default: 3). |
retry_delay |
Numeric. Base delay between retries in seconds (default: 1.0). |
use_cache |
Logical. Use session-scoped cache and conditional
revalidation for MET.NO responses. Defaults to |
cache_dir |
Character. Optional directory path for cache files. If
|
allow_stale_on_error |
Logical. If |
The latitude and longitude are truncated to 4 decimal places as per
MET Weather API Terms of Service. The daily aggregation includes minimum and
maximum temperatures, total precipitation, average and maximum wind speeds,
average relative humidity, average air pressure, average cloud fraction, and
a dominant weather symbol for the day.
A data.table with daily aggregated weather forecasts, including:
date, min_temperature, max_temperature, total_precipitation,
avg_wind_speed, max_wind_speed, avg_relative_humidity,
avg_pressure, avg_cloud_fraction, and dominant_weather_symbol.
Rodrigo Pires, rodrigo.pires@dpird.wa.gov.au
Other METNO:
get_metno_forecast(),
metno_get_dominant_symbol(),
metno_resample_data_table(),
metno_timeseries_to_data_table()
Other data fetching:
get_coastal_forecast(),
get_data_drill(),
get_data_drill_apsim(),
get_dpird_apsim(),
get_dpird_extremes(),
get_dpird_minute(),
get_dpird_summaries(),
get_metno_forecast(),
get_patched_point(),
get_patched_point_apsim(),
get_precis_forecast(),
get_radar_imagery(),
get_satellite_imagery()
## Not run:
# Example of how to use the function (replace with your actual email)
# daily_forecast <- get_metno_daily_forecast(
# latitude = -27.5,
# longitude = 153.0,
# days = 7,
# api_key = "your.email@example.com"
# )
# print(daily_forecast)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.