exclude_preview: Exclude survey previews

View source: R/preview.R

exclude_previewR Documentation

Exclude survey previews

Description

The exclude_preview() function removes rows that are survey previews. The function is written to work with data from Qualtrics surveys.

Usage

exclude_preview(
  x,
  id_col = "ResponseId",
  preview_col = "Status",
  rename = TRUE,
  quiet = TRUE,
  print = TRUE,
  silent = FALSE
)

Arguments

x

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

id_col

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

preview_col

Column name for survey preview.

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.

Details

Default column names are set based on output from the qualtRics::fetch_survey(). The preview 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 are survey previews.

Value

An object of the same type as x that excludes rows that are survey previews. For a function that checks for these rows, use check_preview(). For a function that marks these rows, use mark_preview().

See Also

Other preview functions: check_preview(), mark_preview()

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

Examples

# Exclude survey previews
data(qualtrics_text)
df <- exclude_preview(qualtrics_text)

# Works for Qualtrics data exported as numeric values, too
df <- qualtrics_numeric %>%
  exclude_preview()

# Do not print rows to console
df <- qualtrics_text %>%
  exclude_preview(print = FALSE)

excluder documentation built on Feb. 16, 2023, 7:09 p.m.