diff --git a/R/box.R b/R/box.R index 7783cae..5824f9f 100644 --- a/R/box.R +++ b/R/box.R @@ -105,6 +105,7 @@ osem_boxes = function (exposure = NA, model = NA, grouptag = NA, else if (!is.na(date)) query$date = date_as_utc(date) %>% date_as_isostring() + do.call(get_boxes_, query) } @@ -167,6 +168,11 @@ parse_senseboxdata = function (boxdata) { if (!is.null(lastMeasurement)) thebox$lastMeasurement = isostring_as_date(lastMeasurement) + # add empty sensortype to sensors without type + if(!('sensorType' %in% names(sensors[[1]]))) { + sensors[[1]]$sensorType <- NA + } + # create a dataframe of sensors thebox$sensors = sensors %>% recursive_lapply(function (x) if (is.null(x)) NA else x) %>% # replace NULLs with NA