getValues: Get the values of one/several elements at one/several...

Description Usage Arguments Details Value Examples

Description

The function getValues() makes it possible to get timeseries of meteorological elements at some given stations registered by met.no for a specific period of time and a specific time resolution.

Usage

1
2
getValues(timeserietypeID = NULL, fromPeriod = NULL, toPeriod = NULL,
  stations = NULL, elements = NULL, missingValues = -999)

Arguments

timeserietypeID

0:Daily, 1:Monthly, 2:Hourly, 3:Normal Monthly, 4: Normal Daily, 5:Record Daily (not used)

fromPeriod

string of character yyyymmdd. Omitting this parameter will make it start 3 days earlier from now

toPeriod

string of character yyyymmdd. Omitting this parameter will make it stop now

stations

id of the stations. Can be a scalar or a vector of station ids

elements

meteorlogical element as its code ("TAM", "RR", ...). Can be a vector of elements

missingValues

value of the expected mssing values. By default: -999

Details

rem: timeserietypeID #2 is not always representing the hourly time resolution but also can be infra-hourly. We only keep hourly datasets.

Value

The output is a dataframe structured as followed: the date timeserie, and the elements. Each element is a dataframe made of the timeseries of the different stations. This structure eases the conversion into a json format

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
########################################################
# Get daily temperature amd precipitation              #
# at station no 180 between 01/01/2013 and 05/01/2013  #
########################################################
tmp <- getValues(timeserietypeID="0",
                 fromPeriod="20130101",
                 toPeriod="20130105",
                 stations="180",
                 elements=c("TAM","RR"))
str(tmp)
head(tmp)

########################################################
# Get hourly temperature at stations no 19710          #
# and 2650 between 27/12/2015 and 31/12/2015           #
########################################################
tmp <- getValues(timeserietypeID="2",
                 fromPeriod="2015122700",
                 toPeriod="2015123100",
                 stations=c("19710","2650"),
                 elements=c("TA"))
str(tmp)
head(tmp)

########################################################
# Get monthly temperature and precipitation at         #
# stations no 19710 and 180 between 16/03/2014 and     #
# 31/12/2015                                           #
########################################################
tmp <- getValues(timeserietypeID="1",
                 fromPeriod="201403",
                 toPeriod="201512",
                 stations=c("19710","180"),
                 elements=c("TAM","RR"))
str(tmp)
head(tmp)

########################################################
# Get daily normal temperature at                      #
# stations no 180, 2650                                #
########################################################
tmp <- getValues(timeserietypeID="4",
                 stations=c("180","2650"),
                 elements=c("TAM"))
str(tmp)
head(tmp)

nexModeling/wsklimaR documentation built on May 23, 2019, 4:28 p.m.