plot measurements by sensorId (#1)

also add sensorId & unit as default column
pull/17/head
noerw 7 years ago
parent 790ce35a5a
commit 72c1227a46

@ -91,6 +91,7 @@ osem_measurements.sensebox = function (x, phenomenon, exposure = NA,
# ============================================================================== # ==============================================================================
# #
#' Validates and parses the Parameters for use in \code{osem_measurements()} #' Validates and parses the Parameters for use in \code{osem_measurements()}
#' and sets a default selection of columns, if unspecified
#' #'
#' @param params A named \code{list} of parameters #' @param params A named \code{list} of parameters
#' @return A named \code{list} of parsed parameters. #' @return A named \code{list} of parsed parameters.
@ -118,7 +119,10 @@ parse_get_measurements_params = function (params) {
query$`to-date` = utc_date(params$to) %>% date_as_isostring() query$`to-date` = utc_date(params$to) %>% date_as_isostring()
if (!is.na(params$exposure)) query$exposure = params$exposure if (!is.na(params$exposure)) query$exposure = params$exposure
if (!is.na(params$columns)) query$columns = paste(params$columns, collapse = ',') if (!is.na(params$columns))
query$columns = paste(params$columns, collapse = ',')
else
query$columns = 'value,createdAt,lon,lat,sensorId,unit'
query query
} }

@ -1,6 +1,6 @@
#' @export #' @export
plot.osem_measurements = function (x, ...) { plot.osem_measurements = function (x, ...) {
# TODO: group/color by sensor_id # TODO: group/color by sensor_id
plot(value~createdAt, x, ...) plot(value~createdAt, x, col = factor(x$sensorId), ...)
invisible(x) invisible(x)
} }

Loading…
Cancel
Save