mark_duration | R Documentation |
The mark_duration()
function creates a column labeling
rows with fast and/or slow duration.
The function is written to work with data from
Qualtrics surveys.
mark_duration(
x,
min_duration = 10,
max_duration = NULL,
id_col = "ResponseId",
duration_col = "Duration (in seconds)",
rename = TRUE,
quiet = FALSE,
print = TRUE
)
x |
Data frame (preferably imported from Qualtrics using {qualtRics}). |
min_duration |
Minimum duration that is too fast in seconds. |
max_duration |
Maximum duration that is too slow in seconds. |
id_col |
Column name for unique row ID (e.g., participant). |
duration_col |
Column name for durations. |
rename |
Logical indicating whether to rename columns (using |
quiet |
Logical indicating whether to print message to console. |
print |
Logical indicating whether to print returned tibble to console. |
Default column names are set based on output from the
qualtRics::fetch_survey()
.
By default, minimum durations of 10 seconds are checked, but either
minima or maxima can be checked with the min_duration
and
max_duration
arguments. The function outputs to console separate
messages about the number of rows that are too fast or too slow.
This function returns the fast and slow rows.
An object of the same type as x
that includes a column marking rows
with fast and slow duration.
For a function that checks for these rows, use check_duration()
.
For a function that excludes these rows, use exclude_duration()
.
Other duration functions:
check_duration()
,
exclude_duration()
Other mark functions:
mark_duplicates()
,
mark_ip()
,
mark_location()
,
mark_preview()
,
mark_progress()
,
mark_resolution()
# Mark durations faster than 100 seconds
data(qualtrics_text)
df <- mark_duration(qualtrics_text, min_duration = 100)
# Remove preview data first
df <- qualtrics_text %>%
exclude_preview() %>%
mark_duration()
# Mark only for durations slower than 800 seconds
df <- qualtrics_text %>%
exclude_preview() %>%
mark_duration(max_duration = 800)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.