Usage
coverage(
db,
participant_id,
sensor = NULL,
frequency = mpathsenser::freq,
relative = TRUE,
offset = "None",
start_date = NULL,
end_date = NULL,
plot = deprecated()
)Arguments
- db
A valid database connection. Schema must be that as it is created by open_db.
- participant_id
A character string of one participant ID.
- sensor
A character vector containing one or multiple sensors. See
sensorsfor a list of available sensors. UseNULLfor all available sensors.- frequency
A named numeric vector with sensors as names and the number of expected samples per hour
- relative
Show absolute number of measurements or relative to the expected number? Logical value.
- offset
Currently not used.
- start_date
A date (or convertible to a date using
base::as.Date()) indicating the earliest date to show. Leave empty for all data. Must be used withend_date.- end_date
A date (or convertible to a date using
base::as.Date()) indicating the latest date to show.Leave empty for all data. Must be used withstart_date.- plot
Instead of built-in functionality, use
plot.coverage()to plot the output.
Value
A ggplot of the coverage results if plot is TRUE or a tibble containing the
hour, type of measure (i.e. sensor), and (relative) coverage.
Examples
if (FALSE) { # \dontrun{
freq <- c(
Accelerometer = 720, # Once per 5 seconds. Can have multiple measurements.
AirQuality = 1,
AppUsage = 2, # Once every 30 minutes
Bluetooth = 60, # Once per minute. Can have multiple measurements.
Gyroscope = 720, # Once per 5 seconds. Can have multiple measurements.
Light = 360, # Once per 10 seconds
Location = 60, # Once per 60 seconds
Memory = 60, # Once per minute
Noise = 120,
Pedometer = 1,
Weather = 1,
Wifi = 60 # once per minute
)
coverage(
db = db,
participant_id = "12345",
sensor = c("Accelerometer", "Gyroscope"),
frequency = mpathsenser::freq,
start_date = "2021-01-01",
end_date = "2021-05-01"
)
} # }
