pagesec {gmoTree}R Documentation

Calculate the seconds spent on each page

Description

Create a new variable in the $Time data frame that contains the time spent on each page.

Usage

pagesec(oTree, rounded = TRUE, digits = 2, minutes = FALSE, combine = FALSE)

Arguments

oTree

A list of data frames that were created by import_otree.

rounded

Logical. TRUE if the output should be rounded.

digits

Integer. The number of digits to which the output should be rounded. This parameter has no effect unless rounded = TRUE.

minutes

Logical. TRUE if the output should be minutes instead of seconds.

combine

Logical. TRUE if all variables referring to epoch time should be merged, and all variables referring to participant code should be merged in case data of several versions of oTree are used.

Value

This function returns a duplicate of the original oTree list of data frames that also contains a column in the $Time data frame named seconds_on_page2 or minutes_on_page.

Examples

# Use package-internal list of oTree data frames
oTree <- gmoTree::oTree

# Create two new columns: seconds_on_page2 and minutes_on_page
oTree <- pagesec(oTree, rounded = TRUE, minutes = TRUE)

# Show the Time data frame
head(oTree$Time, n = 30)

[Package gmoTree version 1.1.0 Index]