minor improvements

and re-generate docs
pull/17/head
nuest 6 years ago
parent 1f591b311e
commit bc71b9c0de

@ -15,7 +15,7 @@ get_boxes_ = function (..., endpoint) {
response = osem_request_(endpoint, path = c('boxes'), ...)
if (length(response) == 0) {
warning('no boxes found for this query')
warning('no senseBoxes found for this query')
return(osem_as_sensebox(as.data.frame(response)))
}

@ -19,7 +19,7 @@
#' @param phenomenon Only return boxes that measured the given phenomenon in the
#' time interval as specified through \code{date} or \code{from / to}
#' @param endpoint The URL of the openSenseMap API instance
#' @param progress Whether to print download progress information
#' @param progress Whether to print download progress information defaults to \code{TRUE}
#' @return A \code{sensebox data.frame} containing a box in each row
#'
#' @seealso \href{https://docs.opensensemap.org/#api-Measurements-findAllBoxes}{openSenseMap API documentation (web)}
@ -39,7 +39,7 @@
osem_boxes = function (exposure = NA, model = NA, grouptag = NA,
date = NA, from = NA, to = NA, phenomenon = NA,
endpoint = osem_endpoint(),
progress = T) {
progress = TRUE) {
# error, if phenomenon, but no time given
if (!is.na(phenomenon) && is.na(date) && is.na(to) && is.na(from))

@ -18,7 +18,7 @@
#' @param exposure Filter sensors by their exposure ('indoor', 'outdoor', 'mobile')
#' @param from A \code{POSIXt} like object to select a time interval
#' @param to A \code{POSIXt} like object to select a time interval
#' @param columns Select specific column in the output (see oSeM documentation)
#' @param columns Select specific column in the output (see openSenseMap API documentation)
#' @param endpoint The URL of the openSenseMap API
#' @param progress Whether to print download progress information
#'
@ -130,7 +130,7 @@ parse_get_measurements_params = function (params) {
}
if (!is.na(params$exposure)) query$exposure = params$exposure
if (!is.na(params$columns))
if (!any(is.na(params$columns)))
query$columns = paste(params$columns, collapse = ',')
else
query$columns = 'value,createdAt,lon,lat,sensorId,unit'

@ -91,3 +91,12 @@ openSenseMap API: \url{https://api.opensensemap.org/}
official openSenseMap API documentation: \url{https://docs.opensensemap.org/}
}
\author{
\strong{Maintainer}: Norwin Roosen \email{bugs@nroo.de}
Other contributors:
\itemize{
\item Daniel Nuest \email{daniel.nuest@uni-muenster.de} (0000-0003-2392-6140) [contributor]
}
}

@ -37,7 +37,7 @@ osem_measurements(x, ...)
\item{to}{A \code{POSIXt} like object to select a time interval}
\item{columns}{Select specific column in the output (see oSeM documentation)}
\item{columns}{Select specific column in the output (see openSenseMap API documentation)}
\item{endpoint}{The URL of the openSenseMap API}

@ -63,7 +63,7 @@ test_that("a response with no matches returns empty sensebox data.frame and a wa
test_that("a response with no matches gives a warning", {
check_api()
expect_warning(osem_boxes(grouptag = "does_not_exist"), "no boxes found")
expect_warning(osem_boxes(grouptag = "does_not_exist"), "no senseBoxes found")
})
test_that("data.frame can be converted to sensebox data.frame", {

Loading…
Cancel
Save