R client for OGC SOS

Easing the access to environmental time series data from an OGC Sensor Observation Service

sos4R is an extension package of the R environment for statistical computing and visualization. sos4R is available on CRAN. The user can use it to query data from standardized SOS instances (with specific consideration of the OGC SOS 2.0 Hydrology Profile) using simple R function calls. It provides a convenience layer for R users to integrate observation data from SOS servers compliant with the SOS standard without any knowledge about the underlying OGC Sensor Web Enablement standards.


Key Technologies

  • R Programming Language
  • OGC Sensor Observation Service 2.0
  • OGC WaterML 2.0
  • OGC Observations and Measurements 2.0


  • Easier access to environmental time series data
  • Automatic generation of SOS requests
  • Result handling and parsing into standard R objects
  • Convenience API: Data Science oriented functions to load data

Quick start


# connect to SOS and request metadata
mySos <- SOS(url = "",
             binding = "KVP", useDCPs = FALSE, version = "2.0.0")

# retrieve available phenomena and sites
phenomena <- phenomena(sos = mySos, includeSiteId = TRUE, includeTemporalBBox = TRUE)
siteList(sos = mySos)

# retrieve data
getData(sos = mySos,
        phenomena = phenomena[5,1],
        sites = phenomena[5,2],
        begin = as.POSIXct("2018-01-01"),
        end =   as.POSIXct("2018-01-3"))

Install the development version

You can install the current development version (= the next release for CRAN) directly from GitHub:

remotes::install_github("52North/sos4R", ref = "dev")

User guide

The project website is at You can also join the chat at on Gitter if you have any questions.


sos4R can used to download observation data or build user interfaces for requesting and rendering time series observations. The screenshot below shows a demo Shiny application, which you can run locally with

shiny::runApp(appDir = file.path(path.package("sos4R"), "shiny"))

sos4R Shiny app


The latest changes, updates, bug fixes can be found in the package changelog at


sos4R is used in the following projects.


See file for developer documentation or read the developer documentation online at


This R extension package is licensed under GPL v2.0.

Documentation (e.g. vignette) is published under CC BY 4.0.

sos4R is a project of 52°North Initiative for Geospatial Open Source Software.