View source: R/sensor_functions.R
screen_duration | R Documentation |
Calculate the screen duration time where the screen was unlocked (i.e. not just on).
screen_duration(
db,
participant_id,
start_date = NULL,
end_date = NULL,
by = c("Hour", "Day")
)
db |
A database connection to an m-Path Sense database. |
participant_id |
A character string identifying a single participant. Use
|
start_date |
Optional search window specifying date where to begin search. Must be convertible to date using as.Date. Use first_date to find the date of the first entry for a participant. |
end_date |
Optional search window specifying date where to end search. Must be convertible to date using as.Date. Use last_date to find the date of the last entry for a participant. |
by |
Either 'Hour' or 'Day' indicating how to summarise the results. Leave empty to get raw screen duration per measurement. |
A tibble with either 'hour' and 'duration' columns or 'date' and 'duration' columns
depending on the by
argument. Alternatively, if no by
is specified, a remote
tibble is returned with the date, time, and duration since the previous measurement.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.