weather_now: Retrieve Current Weather from the Open-Meteo API

View source: R/weather_now.R

weather_nowR Documentation

Retrieve Current Weather from the Open-Meteo API

Description

weather_now() calls the Open-Meteo weather API for the most recently recorded weather conditions a given location. Location is provided either as string or c(latitude,longitude).

Usage

weather_now(location, response_units = NULL, timezone = "auto")

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()).

response_units

Supply to convert temperature, windspeed, or precipitation units. This defaults to: ⁠list(temperature_unit = "celsius",⁠ ⁠windspeed_unit = "kmh", precipitation_unit = "mm")⁠

timezone

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

Value

Current weather conditions: temperature, windspeed, wind direction and weathercode.

Examples


# current weather in Montreal
weather_now("Montreal")

# current weather at the North Pole in Imperial units
weather_now(c(90, 0),
  response_units = list(
    temperature_unit = "fahrenheit",
    windspeed_unit = "mph"
  )
)


openmeteo documentation built on Oct. 25, 2023, 5:07 p.m.