climate: Returns temperature, dew temperature, pressure, wind bearing...

Description Usage Arguments Details Value Author(s) Examples

Description

Using the package "darksky" it's possible to get those weather reports.

Usage

1
climate(Ta, La, date)

Arguments

Ta

Latitude of a given location.

La

Longitude of a given location.

date

Date and time to get the weather report. Check example for input format.

Details

To use the package "darksky" to collect weather report, you must activate the API with your key. Check https://darksky.net/dev for more info.

Value

c2

It's a vector containing:

c2[1]

Temperature in Celsius.

c2[2]

Dew temperature in Celsius.

c2[3]

Air pressure in hPa.

c2[4]

Wind bearing on 0<c2><ba>-360<c2><ba> scale. 0<c2><ba> means a wind blowing from North to South, 90<c2><ba> means East to West, 180<c2><ba> means South to North and, finally, 270<c2><ba> is West to East.

c2[5]

Wind speed in m/s.

Author(s)

Natan Freitas Leite

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## The function is currently defined as
function (Ta, La, date)
{
    require(darksky)
    require(weathermetrics)
    c1 = darksky::get_forecast_for(Ta, La, date)
    c2 = 0
    c2[1] = weathermetrics::fahrenheit.to.celsius(c1$currently$temperature,
        2)
    c2[2] = weathermetrics::fahrenheit.to.celsius(c1$currently$dewPoint,
        2)
    c2[3] = c1$currently$pressure
    c2[4] = c1$currently$windBearing
    c2[5] = c1$currently$windSpeed * (16.0934/36)
    return(c2)
  }

##latitude (T) and longitude (L) for S<c3><a3>o Francisco, Niter<c3><b3>i, Brazil
##cycling circuit:
Ta=-22.915396
La=-43.095511
date="2018-04-12T19:00:00"
c=climate(Ta,La,date)
c

Bolshom/optimumtt documentation built on May 24, 2019, 8:56 a.m.