coverage {mpathsenser} | R Documentation |
Create a coverage chart of the sampling rate
Description
Only applicable to non-reactive sensors with 'continuous' sampling
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
|
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 |
end_date |
A date (or convertible to a date using |
plot |
Instead of built-in functionality, use
|
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
## Not run:
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"
)
## End(Not run)