getData: This function queries a SOS v2.0 for time series data

Description Usage Arguments Value Author(s) Examples

View source: R/Wrapper-methods.R

Description

For given sites and phenomena, a SOS is queried and the data returned as data.frame.

Usage

1
getData(sos, phenomena, sites, spatialBBox = NA, begin = NA, end = NA, ...)

Arguments

sos

An SOS object from a call to SOS containing the URL of a SOS v2.0.

phenomena

A list, vector or one-column data.frame with characters identifying the relevant phenomena.

sites

A list, vector or one-column data.frame with characters identifying the relevant sites.

spatialBBox

A 2-by-2 matrix with x and y in the rows and min and max in the columns. See Spatial-class for details. If sites is set, this argument is ignored.

begin

Object of class POSIXt. Note that creating timestamps with as.POSIXct(..) will use your local timezone.

end

Object of class POSIXt. Note that creating timestamps with as.POSIXct(..) will use your local timezone.

...

Named arguments forwarded to other wrapper functions internally.

Value

A data.frame containing the data in long form where each row contains a siteID, the time stamp of the observation and the observed measurements for each phenomenon in a separate column. The measurements are provided with units using units.

Author(s)

Benedikt Graeler, Eike Hinderk Juerrens

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
mySos <- SOS(url = "https://climate-sos.niwa.co.nz/",
             binding = "KVP", useDCPs = FALSE, version = "2.0.0")

observationData <- getData(sos = mySos,
                           phenomena = phenomena[18,1],
                           sites = siteList[1:2,1])

## End(Not run)

sos4R documentation built on July 9, 2020, 5:07 p.m.