rename_columns {excluder}R Documentation

Rename columns to match standard Qualtrics names

Description

The rename_columns() function renames the metadata columns to match standard Qualtrics names.

Usage

rename_columns(x, alert = TRUE)

Arguments

x

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

alert

Logical indicating whether to alert user to the fact that the columns do not match the secondary labels and therefore cannot be renamed.

Details

When importing Qualtrics data using qualtRics::fetch_survey(). labels entered in Qualtrics questions are saved as 'subtitles' for column names. Using sjlabelled::get_label() can make these secondary labels be the primary column names. However, this results in a different set of names for the metadata columns than is used in all of the mark_(), check_(), and exclude_() functions. This function renames these columns to match the standard Qualtrics names.

Value

An object of the same type as x that has column names that match standard Qualtrics names.

See Also

Other column name functions: use_labels()

Examples

# Rename columns
data(qualtrics_fetch)
qualtrics_renamed <- qualtrics_fetch %>%
  rename_columns()
names(qualtrics_fetch)
names(qualtrics_renamed)

# Alerts when columns cannot be renamed
data(qualtrics_numeric)
rename_columns(qualtrics_numeric)

# Turn off alert
rename_columns(qualtrics_numeric, alert = FALSE)


[Package excluder version 0.5.1 Index]