Skip to contents

The exclude_progress() function removes rows that have incomplete progress. The function is written to work with data from Qualtrics surveys.

Usage

exclude_progress(
  x,
  min_progress = 100,
  id_col = "ResponseId",
  finished_col = "Finished",
  progress_col = "Progress",
  rename = TRUE,
  quiet = TRUE,
  print = TRUE,
  silent = FALSE
)

Arguments

x

Data frame (preferably imported from Qualtrics using {qualtRics}).

min_progress

Amount of progress considered acceptable to include.

id_col

Column name for unique row ID (e.g., participant).

finished_col

Column name for whether survey was completed.

progress_col

Column name for percentage of survey completed.

rename

Logical indicating whether to rename columns (using rename_columns())

quiet

Logical indicating whether to print message to console.

print

Logical indicating whether to print returned tibble to console.

silent

Logical indicating whether to print message to console. Note this argument controls the exclude message not the check message.

Value

An object of the same type as x that excludes rows that have incomplete progress. For a function that checks for these rows, use check_progress(). For a function that marks these rows, use mark_progress().

Details

Default column names are set based on output from the qualtRics::fetch_survey(). The default requires 100% completion, but lower levels of completion maybe acceptable and can be allowed by specifying the min_progress argument. The finished column in Qualtrics can be a numeric or character vector depending on whether it is exported as choice text or numeric values. This function works for both.

The function outputs to console a message about the number of rows that have incomplete progress.

See also

Other progress functions: check_progress(), mark_progress()

Other exclude functions: exclude_duplicates(), exclude_duration(), exclude_ip(), exclude_location(), exclude_preview(), exclude_resolution()

Examples

# Exclude rows with incomplete progress
data(qualtrics_text)
df <- exclude_progress(qualtrics_text)
#>  6 out of 100 rows with incomplete progress were excluded, leaving 94 rows.

# Remove preview data first
df <- qualtrics_text %>%
  exclude_preview() %>%
  exclude_progress()
#>  2 out of 100 preview rows were excluded, leaving 98 rows.
#>  6 out of 98 rows with incomplete progress were excluded, leaving 92 rows.

# Include a lower acceptable completion percentage
df <- qualtrics_numeric %>%
  exclude_preview() %>%
  exclude_progress(min_progress = 98)
#>  2 out of 100 preview rows were excluded, leaving 98 rows.
#>  5 out of 98 rows with incomplete progress were excluded, leaving 93 rows.

# Do not print rows to console
df <- qualtrics_text %>%
  exclude_preview() %>%
  exclude_progress(print = FALSE)
#>  2 out of 100 preview rows were excluded, leaving 98 rows.
#>  6 out of 98 rows with incomplete progress were excluded, leaving 92 rows.