apptime {gmoTree} | R Documentation |
Calculate the time that was spent on an app
Description
Calculate the time spent on one app or several apps.
Usage
apptime(
oTree,
apps = NULL,
pcode = NULL,
plabel = NULL,
group_id = NULL,
seconds = FALSE,
rounded = TRUE,
digits = 2,
sinfo = "session_code",
combine = FALSE
)
Arguments
oTree |
A list of data frames created
with |
apps |
Character string or character vector. Name(s) of the app(s) for which the time should be calculated. |
pcode |
Character string. The value of the |
plabel |
Character string. The value of the |
group_id |
Integer. The value of the |
seconds |
Logical. |
rounded |
Logical. |
digits |
Integer.
The number of digits to which the output should be rounded.
This parameter has no effect unless |
sinfo |
Character string. |
combine |
Logical. |
Value
This function returns a list for each app containing information on the mean, the minimum, and maximum time the participants spent on the app, a data frame with information on the time each participant spent on the app, and eventually, vectors of relevant background information on these numbers.
If the experiment's duration is only calculated for one participant,
the output returns an NA
(per app) if the person did not make
it to the app(s).
Examples
# Use package-internal list of oTree data frames
oTree <- gmoTree::oTree
# Show how much time all participants spent on app "survey"
apptime(oTree, apps = "survey")
# Show how much time the participant "a7dppel1" spent on
# the app "survey"
apptime(oTree, pcode = "a7dppel1", apps = "survey")
# Show how much time the participants in group 4 spent on
# the app "survey"
oTree <- make_ids(oTree,
gmake = TRUE,
from_var = "dictator.1.group.id_in_subsession"
)
apptime(oTree, group_id = 4, apps = "survey")
# Show how much time all participants spent on all apps
apptime(oTree)