mirror of
https://github.com/sensebox/opensensmapr
synced 2025-06-09 20:06:10 +02:00
plot measurements by sensorId (#1)
also add sensorId & unit as default column
This commit is contained in:
parent
790ce35a5a
commit
72c1227a46
2 changed files with 6 additions and 2 deletions
|
@ -91,6 +91,7 @@ osem_measurements.sensebox = function (x, phenomenon, exposure = NA,
|
|||
# ==============================================================================
|
||||
#
|
||||
#' 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
|
||||
#' @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()
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#' @export
|
||||
plot.osem_measurements = function (x, ...) {
|
||||
# TODO: group/color by sensor_id
|
||||
plot(value~createdAt, x, ...)
|
||||
plot(value~createdAt, x, col = factor(x$sensorId), ...)
|
||||
invisible(x)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue