Learn R Programming

sos4R (version 0.4.2)

siteList: This function queries a SOS v2.0 for its sites and returns them as data.frame

Description

Information about the registered sites in a SOS can be queried using this function. This function allows for different levels of detail and returns a vector or data.frame.

Usage

siteList(sos,
         empty = FALSE,
         begin = NA,
         end = NA,
         phenomena = list(),
         includePhenomena = FALSE,
         includeTemporalBBox = FALSE,
         ...)

Arguments

sos

A SOS object from a call to SOS containing the URL of a SOS.

empty

Whether also empty sites shall be included in the response.

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.

phenomena

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

includePhenomena

Whether the phenomena shall also be reported in the result.

includeTemporalBBox

Whether the observation containing timespan of each phenomenon shall also be reported.

...

Named parameters passed on to other wrapper functions.

Value

If only the argument sos is provided and the flag empty is set to TRUE or FALSE, this function returns a character vector with the site ids.

If listPhenomena = TRUE, the data.frame contains the column containing the site ids and a character column phenomenon where sites with several phenomena are repeated for each of their phenomenon.

If includeTemporalBBox = TRUE, the data.frame also contains two character columns beginTime and endTime indicating per site id and phenomenon its earliest and latest observation time point.

Examples

Run this code
# NOT RUN {
mySos <- SOS(url = "https://climate-sos.niwa.co.nz/",
             binding = "KVP", useDCPs = FALSE, version = "2.0.0")
siteList(sos = mySos)
# }

Run the code above in your browser using DataLab