remove_label_rows: Remove two initial rows created in Qualtrics data

View source: R/remove_label_rows.R

remove_label_rowsR Documentation

Remove two initial rows created in Qualtrics data

Description

The remove_label_rows() function filters out the initial label rows from datasets downloaded from Qualtrics surveys.

Usage

remove_label_rows(x, convert = TRUE, rename = FALSE)

Arguments

x

Data frame (downloaded from Qualtrics).

convert

Logical indicating whether to convert/coerce date, logical and numeric columns from the metadata.

rename

Logical indicating whether to rename columns based on first row of data.

Details

The function (1) checks if the data set uses Qualtrics column names, (2) checks if label rows are already used as column names, (3) removes label rows if present, and (4) converts date, logical, and numeric metadata columns to proper data type. Datasets imported using qualtRics::fetch_survey() should not need this function.

The convert argument only converts the StartDate, EndDate, RecordedDate, Progress, Finished, Duration (in seconds), LocationLatitude, and LocationLongitude columns. To convert other data columns, see dplyr::mutate().

Value

An object of the same type as x that excludes Qualtrics label rows and with date, logical, and numeric metadata columns converted to the correct data class.

Examples

# Remove label rows
data(qualtrics_raw)
df <- remove_label_rows(qualtrics_raw)

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