check_resolution: Check screen resolution

View source: R/resolution.R

check_resolutionR Documentation

Check screen resolution

Description

The check_resolution() function subsets rows of data, retaining rows that have unacceptable screen resolution. This can be used, for example, to determine data collected via phones when desktop monitors are required. The function is written to work with data from Qualtrics surveys.

Usage

check_resolution(
  x,
  res_min = 1000,
  width_min = 0,
  height_min = 0,
  id_col = "ResponseId",
  res_col = "Resolution",
  rename = TRUE,
  keep = FALSE,
  quiet = FALSE,
  print = TRUE
)

Arguments

x

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

res_min

Minimum acceptable screen resolution (width and height).

width_min

Minimum acceptable screen width.

height_min

Minimum acceptable screen height.

id_col

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

res_col

Column name for screen resolution (in format widthxheight).

rename

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

keep

Logical indicating whether to keep or remove exclusion column.

quiet

Logical indicating whether to print message to console.

print

Logical indicating whether to print returned tibble to console.

Details

To record this information in your Qualtrics survey, you must insert a meta info question.

Default column names are set based on output from the qualtRics::fetch_survey().

The function outputs to console a message about the number of rows with unacceptable screen resolution.

Value

The output is a data frame of the rows that have unacceptable screen resolutions. This includes new columns for resolution width and height. For a function that marks these rows, use mark_resolution(). For a function that excludes these rows, use exclude_resolution().

See Also

Other resolution functions: exclude_resolution(), mark_resolution()

Other check functions: check_duplicates(), check_duration(), check_ip(), check_location(), check_preview(), check_progress()

Examples

# Check for survey previews
data(qualtrics_text)
check_resolution(qualtrics_text)

# Remove preview data first
qualtrics_text %>%
  exclude_preview() %>%
  check_resolution()

# Do not print rows to console
qualtrics_text %>%
  exclude_preview() %>%
  check_resolution(print = FALSE)

# Do not print message to console
qualtrics_text %>%
  exclude_preview() %>%
  check_resolution(quiet = TRUE)

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