read_neuromap_demg: read and clean demographic data from Qualtrics

View source: R/read_neuromap_demg.R

read_neuromap_demgR Documentation

read and clean demographic data from Qualtrics

Description

This function pulls the demographic data and S3 or S5 session report from Qualtrics. Cleans the demog data and adds the sessions date and age when the task was run. If Qualtrics is not setup on your Rstudio install the qualtRics library and run the following command to connect to the Qualtrics server. qualtrics_api_credentials(api_key = "<YOUR-QUALTRICS_API_KEY>", base_url = "<YOUR-QUALTRICS_BASE_URL>", install = TRUE)

Usage

read_neuromap_demg(
  session = "s3",
  task = "N",
  demg_cols = "simple",
  skip_age = FALSE
)

Arguments

session

which session should the date the task was run be pulled from: "s3" or "s5"

task

name of the task whose session date will be pulled into the demographic data in s_date column, which is used to calculate age of the participant at the time the session was run. "N": neighborhood, "K": defend the kingdom, "S": sorting mushroom, "V": vending machine, "W": weather prediction, "B": vanilla baseline

demg_cols

character requesting a subset of columns to return. either "all", "detailed", or "simple". Defaults to "simple". simple: ID, gender, date of birth, ethnicity, race, sex_orientation, work, education, house_income, and self_income. detailed: simple + city of birth, more detailed relationship information, and more detailed sexuality information. all: detailed + all other columns

skip_age

logical defaults to FALSE. If TRUE, only returns the demographic data. If FALSE, returns the demographic data + age at the time of s3 or s5.

Author(s)

Nidhi Desai

Nate Hall

Examples

 ## Not run: 
    demg_cleaned <- read_demg("s3", "K")
 
## End(Not run)


PennStateDEPENdLab/dependlab documentation built on April 10, 2024, 5:15 p.m.