mongo.rune | R Documentation |
This function fetches a MongoDB collection containing multiple collections and separates it into individual data frames for each collection detected in the data. It identifies the appropriate identifier column (e.g., participantId, workerId) and splits the data based on column name prefixes.
mongo.rune(collection, db_name = NULL, lower = TRUE)
collection |
Character string specifying the Mongo collection |
db_name |
Character string specifying the Mongo database |
lower |
default TRUE convert prefixes to lower case |
The function performs the following steps:
Retrieves the raw Qualtrics data using the getSurvey() function
Identifies which identifier column to use (participantId, workerId, PROLIFIC_PID, or src_subject_id)
Determines survey prefixes by analyzing column names
Creates separate dataframes for each survey prefix found
Assigns each dataframe to the global environment with names matching the survey prefixes
Creates multiple dataframes in the global environment, one for each survey detected in the data. Each dataframe is named after its survey prefix.
## Not run:
# Parse a Qualtrics export containing multiple surveys
mongo.rune("combined_surveys", label = FALSE)
# After running, access individual survey dataframes directly:
head(pss) # Access the PSS survey dataframe
head(cesd) # Access the CESD survey dataframe
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.