mirror of
https://github.com/sensebox/opensensmapr
synced 2025-02-22 23:23:57 +01:00
updated manual
This commit is contained in:
parent
35c3014dee
commit
4b24aa9582
7 changed files with 88 additions and 27 deletions
|
@ -112,11 +112,16 @@ openSenseMap API: \url{https://api.opensensemap.org/}
|
||||||
official openSenseMap API documentation: \url{https://docs.opensensemap.org/}
|
official openSenseMap API documentation: \url{https://docs.opensensemap.org/}
|
||||||
}
|
}
|
||||||
\author{
|
\author{
|
||||||
\strong{Maintainer}: Norwin Roosen \email{hello@nroo.de}
|
\strong{Maintainer}: Jan Stenkamp \email{jan.stenkamp@uni-muenster.de} [contributor]
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
\itemize{
|
||||||
|
\item Norwin Roosen \email{hello@nroo.de}
|
||||||
|
}
|
||||||
|
|
||||||
Other contributors:
|
Other contributors:
|
||||||
\itemize{
|
\itemize{
|
||||||
\item Daniel Nuest \email{daniel.nuest@uni-muenster.de} (0000-0003-2392-6140) [contributor]
|
\item Daniel Nuest \email{daniel.nuest@uni-muenster.de} (\href{https://orcid.org/0000-0003-2392-6140}{ORCID}) [contributor]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ A \code{sensebox data.frame} containing a box in each row
|
||||||
Get a single senseBox by its ID
|
Get a single senseBox by its ID
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
\donttest{
|
\dontrun{
|
||||||
# get a specific box by ID
|
# get a specific box by ID
|
||||||
b = osem_box('57000b8745fd40c8196ad04c')
|
b = osem_box('57000b8745fd40c8196ad04c')
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,19 @@
|
||||||
\alias{osem_boxes}
|
\alias{osem_boxes}
|
||||||
\title{Get a set of senseBoxes from the openSenseMap}
|
\title{Get a set of senseBoxes from the openSenseMap}
|
||||||
\usage{
|
\usage{
|
||||||
osem_boxes(exposure = NA, model = NA, grouptag = NA, date = NA,
|
osem_boxes(
|
||||||
from = NA, to = NA, phenomenon = NA, endpoint = osem_endpoint(),
|
exposure = NA,
|
||||||
progress = TRUE, cache = NA)
|
model = NA,
|
||||||
|
grouptag = NA,
|
||||||
|
date = NA,
|
||||||
|
from = NA,
|
||||||
|
to = NA,
|
||||||
|
phenomenon = NA,
|
||||||
|
bbox = NA,
|
||||||
|
endpoint = osem_endpoint(),
|
||||||
|
progress = TRUE,
|
||||||
|
cache = NA
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{exposure}{Only return boxes with the given exposure ('indoor', 'outdoor', 'mobile')}
|
\item{exposure}{Only return boxes with the given exposure ('indoor', 'outdoor', 'mobile')}
|
||||||
|
@ -24,6 +34,11 @@ osem_boxes(exposure = NA, model = NA, grouptag = NA, date = NA,
|
||||||
\item{phenomenon}{Only return boxes that measured the given phenomenon in the
|
\item{phenomenon}{Only return boxes that measured the given phenomenon in the
|
||||||
time interval as specified through \code{date} or \code{from / to}}
|
time interval as specified through \code{date} or \code{from / to}}
|
||||||
|
|
||||||
|
\item{bbox}{Only return boxes that are within the given boundingbox,
|
||||||
|
vector of 4 WGS84 coordinates.
|
||||||
|
Order is: longitude southwest, latitude southwest, longitude northeast, latitude northeast.
|
||||||
|
Minimal and maximal values are: -180, 180 for longitude and -90, 90 for latitude.}
|
||||||
|
|
||||||
\item{endpoint}{The URL of the openSenseMap API instance}
|
\item{endpoint}{The URL of the openSenseMap API instance}
|
||||||
|
|
||||||
\item{progress}{Whether to print download progress information, defaults to \code{TRUE}}
|
\item{progress}{Whether to print download progress information, defaults to \code{TRUE}}
|
||||||
|
@ -46,7 +61,7 @@ Note that some filters do not work together:
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
|
|
||||||
\donttest{
|
\dontrun{
|
||||||
# get *all* boxes available on the API
|
# get *all* boxes available on the API
|
||||||
b = osem_boxes()
|
b = osem_boxes()
|
||||||
|
|
||||||
|
|
17
man/osem_ensure_api_available.Rd
Normal file
17
man/osem_ensure_api_available.Rd
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
% Generated by roxygen2: do not edit by hand
|
||||||
|
% Please edit documentation in R/api.R
|
||||||
|
\name{osem_ensure_api_available}
|
||||||
|
\alias{osem_ensure_api_available}
|
||||||
|
\title{Check if the given openSenseMap API endpoint is available}
|
||||||
|
\usage{
|
||||||
|
osem_ensure_api_available(endpoint = osem_endpoint())
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{endpoint}{The API base URL to check, defaulting to \code{\link{osem_endpoint}}}
|
||||||
|
}
|
||||||
|
\value{
|
||||||
|
\code{TRUE} if the API is available, otherwise \code{stop()} is called.
|
||||||
|
}
|
||||||
|
\description{
|
||||||
|
Check if the given openSenseMap API endpoint is available
|
||||||
|
}
|
|
@ -11,13 +11,31 @@ osem_measurements(x, ...)
|
||||||
|
|
||||||
\method{osem_measurements}{default}(x, ...)
|
\method{osem_measurements}{default}(x, ...)
|
||||||
|
|
||||||
\method{osem_measurements}{bbox}(x, phenomenon, exposure = NA,
|
\method{osem_measurements}{bbox}(
|
||||||
from = NA, to = NA, columns = NA, ...,
|
x,
|
||||||
endpoint = osem_endpoint(), progress = T, cache = NA)
|
phenomenon,
|
||||||
|
exposure = NA,
|
||||||
|
from = NA,
|
||||||
|
to = NA,
|
||||||
|
columns = NA,
|
||||||
|
...,
|
||||||
|
endpoint = osem_endpoint(),
|
||||||
|
progress = T,
|
||||||
|
cache = NA
|
||||||
|
)
|
||||||
|
|
||||||
\method{osem_measurements}{sensebox}(x, phenomenon, exposure = NA,
|
\method{osem_measurements}{sensebox}(
|
||||||
from = NA, to = NA, columns = NA, ...,
|
x,
|
||||||
endpoint = osem_endpoint(), progress = T, cache = NA)
|
phenomenon,
|
||||||
|
exposure = NA,
|
||||||
|
from = NA,
|
||||||
|
to = NA,
|
||||||
|
columns = NA,
|
||||||
|
...,
|
||||||
|
endpoint = osem_endpoint(),
|
||||||
|
progress = T,
|
||||||
|
cache = NA
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{x}{Depending on the method, either
|
\item{x}{Depending on the method, either
|
||||||
|
@ -58,13 +76,13 @@ a bounding box spanning the whole world.
|
||||||
}
|
}
|
||||||
\section{Methods (by class)}{
|
\section{Methods (by class)}{
|
||||||
\itemize{
|
\itemize{
|
||||||
\item \code{default}: Get measurements from \strong{all} senseBoxes.
|
\item \code{osem_measurements(default)}: Get measurements from \strong{all} senseBoxes.
|
||||||
|
|
||||||
\item \code{bbox}: Get measurements by a spatial filter.
|
\item \code{osem_measurements(bbox)}: Get measurements by a spatial filter.
|
||||||
|
|
||||||
|
\item \code{osem_measurements(sensebox)}: Get measurements from a set of senseBoxes.
|
||||||
|
|
||||||
\item \code{sensebox}: Get measurements from a set of senseBoxes.
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
\examples{
|
\examples{
|
||||||
\donttest{
|
\donttest{
|
||||||
# get measurements from all boxes on the phenomenon 'PM10' from the last 48h
|
# get measurements from all boxes on the phenomenon 'PM10' from the last 48h
|
||||||
|
|
|
@ -7,8 +7,14 @@
|
||||||
\usage{
|
\usage{
|
||||||
osem_measurements_archive(x, ...)
|
osem_measurements_archive(x, ...)
|
||||||
|
|
||||||
\method{osem_measurements_archive}{sensebox}(x, fromDate,
|
\method{osem_measurements_archive}{sensebox}(
|
||||||
toDate = fromDate, sensorFilter = ~T, ..., progress = T)
|
x,
|
||||||
|
fromDate,
|
||||||
|
toDate = fromDate,
|
||||||
|
sensorFilter = ~T,
|
||||||
|
...,
|
||||||
|
progress = T
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{x}{A `sensebox data.frame` of a single box, as retrieved via \code{\link{osem_box}},
|
\item{x}{A `sensebox data.frame` of a single box, as retrieved via \code{\link{osem_box}},
|
||||||
|
@ -42,15 +48,15 @@ but continue the remaining download.
|
||||||
}
|
}
|
||||||
\section{Methods (by class)}{
|
\section{Methods (by class)}{
|
||||||
\itemize{
|
\itemize{
|
||||||
\item \code{sensebox}: Get daywise measurements for one or more sensors of a single box.
|
\item \code{osem_measurements_archive(sensebox)}: Get daywise measurements for one or more sensors of a single box.
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
\examples{
|
\examples{
|
||||||
# fetch measurements for a single day
|
|
||||||
box = osem_box('593bcd656ccf3b0011791f5a')
|
|
||||||
m = osem_measurements_archive(box, as.POSIXlt('2018-09-13'))
|
|
||||||
|
|
||||||
\donttest{
|
\donttest{
|
||||||
|
# fetch measurements for a single day
|
||||||
|
box = osem_box('593bcd656ccf3b0011791f5a')
|
||||||
|
m = osem_measurements_archive(box, as.POSIXlt('2018-09-13'))
|
||||||
|
|
||||||
# fetch measurements for a date range and selected sensors
|
# fetch measurements for a date range and selected sensors
|
||||||
sensors = ~ phenomenon \%in\% c('Temperatur', 'Beleuchtungsstärke')
|
sensors = ~ phenomenon \%in\% c('Temperatur', 'Beleuchtungsstärke')
|
||||||
m = osem_measurements_archive(
|
m = osem_measurements_archive(
|
||||||
|
|
|
@ -21,10 +21,10 @@ Get the counts of sensors for each observed phenomenon.
|
||||||
}
|
}
|
||||||
\section{Methods (by class)}{
|
\section{Methods (by class)}{
|
||||||
\itemize{
|
\itemize{
|
||||||
\item \code{sensebox}: Get counts of sensors observing each phenomenon
|
\item \code{osem_phenomena(sensebox)}: Get counts of sensors observing each phenomenon
|
||||||
from a set of senseBoxes.
|
from a set of senseBoxes.
|
||||||
}}
|
|
||||||
|
|
||||||
|
}}
|
||||||
\examples{
|
\examples{
|
||||||
# get the phenomena for a single senseBox
|
# get the phenomena for a single senseBox
|
||||||
osem_phenomena(osem_box('593bcd656ccf3b0011791f5a'))
|
osem_phenomena(osem_box('593bcd656ccf3b0011791f5a'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue