From 5ea78e9505fa2d909fdf52a0e130fb581b809a00 Mon Sep 17 00:00:00 2001 From: noerw Date: Mon, 14 Aug 2017 18:13:20 +0200 Subject: [PATCH] add man/* to version control --- .gitignore | 2 +- man/opensensmapr.Rd | 44 ++++++++++++++++++++ man/osem_as_sf.Rd | 21 ++++++++++ man/osem_box.Rd | 29 +++++++++++++ man/osem_boxes.Rd | 56 +++++++++++++++++++++++++ man/osem_counts.Rd | 23 +++++++++++ man/osem_measurements.Rd | 89 ++++++++++++++++++++++++++++++++++++++++ man/osem_phenomena.Rd | 44 ++++++++++++++++++++ 8 files changed, 307 insertions(+), 1 deletion(-) create mode 100644 man/opensensmapr.Rd create mode 100644 man/osem_as_sf.Rd create mode 100644 man/osem_box.Rd create mode 100644 man/osem_boxes.Rd create mode 100644 man/osem_counts.Rd create mode 100644 man/osem_measurements.Rd create mode 100644 man/osem_phenomena.Rd diff --git a/.gitignore b/.gitignore index 36e0140..1564020 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ .Ruserdata *.log inst/doc -man + diff --git a/man/opensensmapr.Rd b/man/opensensmapr.Rd new file mode 100644 index 0000000..0a35cd7 --- /dev/null +++ b/man/opensensmapr.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/opensensmapr.R +\docType{package} +\name{opensensmapr} +\alias{opensensmapr} +\alias{opensensmapr-package} +\alias{opensensmapr-package} +\title{opensensmapr: Work with sensor data from opensensemap.org} +\description{ +The opensensmapr package provides three categories functions: +\enumerate{ + \item retrieval of senseBoxes + \item retrieval of measurements + \item general stats about the openSenseMap database +} +} +\section{Retrieving senseBox metadata}{ + +TODO +} + +\section{Retrieving measurements}{ + +TODO +} + +\section{Retrieving statistics}{ + +TODO +} + +\section{Working with spatial data from openSenseMap}{ + +TODO +} + +\seealso{ +Useful links: +\itemize{ + \item \url{http://github.com/noerw/opensensmapR} + \item Report bugs at \url{http://github.com/noerw/opensensmapR/issues} +} + +} diff --git a/man/osem_as_sf.Rd b/man/osem_as_sf.Rd new file mode 100644 index 0000000..833e1f3 --- /dev/null +++ b/man/osem_as_sf.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{osem_as_sf} +\alias{osem_as_sf} +\title{Convert a \code{sensebox} or \code{osem_measurements} dataframe to an +\code{\link[sf]{st_sf}} object.} +\usage{ +osem_as_sf(x, ...) +} +\arguments{ +\item{x}{The object to convert} + +\item{...}{maybe more objects to convert} +} +\value{ +The object with an st_geometry column attached. +} +\description{ +Convert a \code{sensebox} or \code{osem_measurements} dataframe to an +\code{\link[sf]{st_sf}} object. +} diff --git a/man/osem_box.Rd b/man/osem_box.Rd new file mode 100644 index 0000000..fd83544 --- /dev/null +++ b/man/osem_box.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/box.R +\name{osem_box} +\alias{osem_box} +\title{Get a single senseBox by its ID} +\usage{ +osem_box(boxId, endpoint = "https://api.opensensemap.org") +} +\arguments{ +\item{boxId}{A string containing a senseBox ID} + +\item{endpoint}{The URL of the openSenseMap API instance} +} +\value{ +A \code{sensebox data.frame} containing a box in each row +} +\description{ +Get a single senseBox by its ID +} +\examples{ +# get a specific box by ID +b = osem_box('593bcd656ccf3b0011791f5a') + +} +\seealso{ +\href{https://docs.opensensemap.org/#api-Measurements-findAllBoxes}{openSenseMap API documentation (web)} + +\code{\link{osem_phenomena}} +} diff --git a/man/osem_boxes.Rd b/man/osem_boxes.Rd new file mode 100644 index 0000000..ebf8578 --- /dev/null +++ b/man/osem_boxes.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/box.R +\name{osem_boxes} +\alias{osem_boxes} +\title{Get a set of senseBoxes from the openSenseMap} +\usage{ +osem_boxes(exposure = NA, model = NA, grouptag = NA, date = NA, + from = NA, to = NA, phenomenon = NA, + endpoint = "https://api.opensensemap.org") +} +\arguments{ +\item{exposure}{Only return boxes with the given exposure ('indoor', 'outdoor', 'mobile')} + +\item{model}{Only return boxes with the given model} + +\item{grouptag}{Only return boxes with the given grouptag} + +\item{date}{Only return boxes that were measuring within ±4 hours of the given time} + +\item{from}{Only return boxes that were measuring later than this time} + +\item{to}{Only return boxes that were measuring earlier than this time} + +\item{phenomenon}{Only return boxes that measured the given phenomenon in the +time interval as specified through \code{date} or \code{from / to}} + +\item{endpoint}{The URL of the openSenseMap API instance} +} +\value{ +A \code{sensebox data.frame} containing a box in each row +} +\description{ +Boxes can be selected by a set of filters. +Note that some filters do not work together: +\enumerate{ + \item \code{phenomenon} can only be applied together with \code{date} or + \code{from / to} + \item \code{date} and \code{from / to} cannot be specified together +} +} +\examples{ +# get *all* boxes available on the API +b = osem_boxes() + +# get all boxes with grouptag 'ifgi' that are placed outdoors +b = osem_boxes(grouptag = 'ifgi', exposure = 'outdoor') + +# get all boxes that have measured PM2.5 in the last 4 hours +b = osem_boxes(date = Sys.time(), phenomenon = 'PM2.5') + +} +\seealso{ +\href{https://docs.opensensemap.org/#api-Measurements-findAllBoxes}{openSenseMap API documentation (web)} + +\code{\link{osem_phenomena}} +} diff --git a/man/osem_counts.Rd b/man/osem_counts.Rd new file mode 100644 index 0000000..eff45d9 --- /dev/null +++ b/man/osem_counts.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/counts.R +\name{osem_counts} +\alias{osem_counts} +\title{Get count statistics of the openSenseMap Instance} +\usage{ +osem_counts(endpoint = "https://api.opensensemap.org") +} +\arguments{ +\item{endpoint}{The URL of the openSenseMap API} +} +\value{ +A named \code{list} containing the counts +} +\description{ +Provides information on number of senseBoxes, measurements, and measurements per minute. +} +\details{ +Note that the API caches these values for 5 minutes. +} +\seealso{ +\href{https://docs.opensensemap.org/#api-Misc-getStatistics}{openSenseMap API documentation (web)} +} diff --git a/man/osem_measurements.Rd b/man/osem_measurements.Rd new file mode 100644 index 0000000..9f0e082 --- /dev/null +++ b/man/osem_measurements.Rd @@ -0,0 +1,89 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/measurement.R +\name{osem_measurements} +\alias{osem_measurements} +\alias{osem_measurements.default} +\alias{osem_measurements.bbox} +\alias{osem_measurements.sensebox} +\title{Get the Measurements of a Phenomenon on opensensemap.org} +\usage{ +osem_measurements(x, ...) + +\method{osem_measurements}{default}(x, ...) + +\method{osem_measurements}{bbox}(x, phenomenon, exposure = NA, from = NA, + to = NA, columns = NA, ..., endpoint = "https://api.opensensemap.org") + +\method{osem_measurements}{sensebox}(x, phenomenon, exposure = NA, + from = NA, to = NA, columns = NA, ..., + endpoint = "https://api.opensensemap.org") +} +\arguments{ +\item{x}{Depending on the method, either +\enumerate{ + \item a \code{chr} specifying the phenomenon, see \code{phenomenon} + \item a \code{\link[sf]{st_bbox}} to select sensors spatially, + \item a \code{sensebox data.frame} to select boxes from which + measurements will be retrieved, +}} + +\item{...}{see parameters below} + +\item{phenomenon}{The phenomenon to retrieve measurements for} + +\item{exposure}{Filter sensors by their exposure ('indoor', 'outdoor', 'mobile')} + +\item{from}{A \code{POSIXt} like object to select a time interval} + +\item{to}{A \code{POSIXt} like object to select a time interval} + +\item{columns}{Select specific column in the output (see oSeM documentation)} + +\item{endpoint}{The URL of the openSenseMap API} +} +\value{ +An \code{osem_measurements data.frame} containing the + requested measurements +} +\description{ +Measurements can be retrieved either for a set of boxes, or through a spatial +bounding box filter. To get all measurements, the \code{default} function applies +a bounding box spanning the whole world. +} +\section{Methods (by class)}{ +\itemize{ +\item \code{default}: Get measurements from \strong{all} senseBoxes. + +\item \code{bbox}: Get measurements by a spatial filter. + +\item \code{sensebox}: Get measurements from a set of senseBoxes. +}} + +\examples{ +# get measurements from all boxes +\dontrun{ +osem_measurements('PM2.5') +} + +# get measurements from sensors within a bounding box +bbox = structure(c(7, 51, 8, 52), class = 'bbox') +osem_measurements(bbox, 'Temperatur') + +points = sf::st_multipoint(matrix(c(7, 8, 51, 52), 2, 2)) +bbox2 = sf::st_bbox(points) +osem_measurements(bbox2, 'Temperatur', exposure = 'outdoor') + +# get measurements from a set of boxes +b = osem_boxes(grouptag = 'ifgi') +osem_measurements(b, phenomenon = 'Temperatur') + +# ...or a single box +b = osem_box('593bcd656ccf3b0011791f5a') +osem_measurements(b, phenomenon = 'Temperatur') + +} +\seealso{ +\href{https://docs.opensensemap.org/#api-Measurements-getDataMulti}{openSenseMap API documentation (web)} + +\code{\link{osem_boxes}} +} diff --git a/man/osem_phenomena.Rd b/man/osem_phenomena.Rd new file mode 100644 index 0000000..14f7b0f --- /dev/null +++ b/man/osem_phenomena.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/phenomena.R +\name{osem_phenomena} +\alias{osem_phenomena} +\alias{osem_phenomena.sensebox} +\title{Get the counts of sensors for each observed phenomenon.} +\usage{ +osem_phenomena(boxes) + +\method{osem_phenomena}{sensebox}(boxes) +} +\arguments{ +\item{boxes}{A \code{sensebox data.frame} of boxes} +} +\value{ +A named \code{list} containing the count of sensors observing a + phenomenon per phenomenon +} +\description{ +Get the counts of sensors for each observed phenomenon. +} +\section{Methods (by class)}{ +\itemize{ +\item \code{sensebox}: Get counts of sensors observing each phenomenon +from a set of senseBoxes. +}} + +\examples{ +# get the phenomena for a single senseBox +osem_phenomena(osem_box('593bcd656ccf3b0011791f5a')) + +# get the phenomena for a group of senseBoxes +osem_phenomena( + osem_boxes(grouptag = 'ifgi', exposure = 'outdoor', date = Sys.time()) +) + +# get phenomena with at least 10 sensors on opensensemap +phenoms = osem_phenomena(osem_boxes()) +names(phenoms[phenoms > 9]) + +} +\seealso{ +\code{\link{osem_boxes}} +}