locationforecast: Weather forecast for a specified place

Description Usage Arguments Details Value Author(s) Examples

View source: R/locationforecast.R

Description

Obtaining weather forecasts from api.met.no Locationforecast service. Note that using this function you are agreeing to the Norwegian Meteorologisk Institutt conditions of service at http://api.met.no/conditions_service.html. Also, using the location query option you are agreeing to the Google Maps API Terms of Service at https://developers.google.com/maps/terms.

Usage

1
2
locationforecast(lat,lon,elevation=NULL,location=NULL,exact=TRUE,
tz=Sys.timezone(),key=NULL)

Arguments

lat, lon

numeric objects. latitude and longitude of a location in decimal degrees

elevation

optional numeric object. metres above sea level

location

optional character object. query latitude, longitude and elevation of the location using Google map service

exact

logical, indicating an exact time or an interval period forecasts

tz

time zone format. system time zone by default

key

Google API key

Details

If exact=FALSE, precipitation and temperature range can be obtained since these are computed as interval quantities.

Value

If exact=TRUE, A data frame is returned with the following quantities:

time

time of the forecasts

temperature

temperature (Celcius)

windDirection

wind direction (degree)

windSpeed_mps

wind speed (mps)

windSpeed_beaufort

wind speed (Beaufort scale)

windSpeed_name

wind speed category

windGust

gust (mps)

humidity

humidity (percentage)

pressure

atomospheric pressure (hPa)

cloudiness

clouds cover (percentage)

lowClouds

low clouds cover (percentage)

mediumClouds

medium clouds cover (percentage)

highClouds

high clouds cover (percentage)

dewpointTemperature

dewpoint temperature (Celcius)

If exact=FALSE, A data frame is returned with the following quantities:

timefrom

the start time of interval for the forecasts

timeto

the end time of interval for the forecasts

precipitation

precipitation amount (mm)

minTemperature

minimum temperature in the interval (Celcius)

maxTemperature

maximum temperature in the interval (Celcius)

weather_id

weather category

Author(s)

Stan Yip

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Get exact time location forecast of Hong Kong
locationforecast(lat=22.39643,lon=114.1095)
# Get time interval location forecast of Malta
locationforecast(lat=35.9375,lon=14.37542,exact=FALSE)
# Get exact time location forecast of Cape Town, South Africa with timezone 'Africa/Johannesburg'
locationforecast(location='Cape Town, South Africa', tz='Africa/Johannesburg')

## End(Not run)

weatherr documentation built on July 9, 2020, 9:06 a.m.