Creates a Qualtrics importable survey file from a CSV file of questions.
Source:R/ThinkingGrid.R
generate_survey.Rd
Creates a Qualtrics importable survey file from a CSV file of questions.
Usage
generate_survey(
survey_setup_file,
output_file_name = "output_survey",
question_text = TRUE
)
Arguments
- survey_setup_file
character, required Path to a csv file containing the survey setup. This file MUST have a column called "id". Each row in this column should be unique. Indivudial thinking grids will be created for each row in this column. The other column is called "question". This column contains the question text. Quotes around question text is not required. If the question text is not provided, the function will use default text. Please note that these columns are case sensitive.
File setup for csv file without question text. For this to work the question_text parameter should be set to FALSE. A placeholder text ("Insert text here.") will be used in this case.:
id
ThinkingGrid1
ThinkingGrid2
ThinkingGrid3
File setup for csv file with question text:
id,question ThinkingGrid1,Report your thoughts on the thinking grid 1 ThinkingGrid2,Report your thoughts on the thinking grid 2 ThinkingGrid3,Report your thoughts on the thinking grid 3
The above file will create 3 thinking grids with the corresponding questions.
- output_file_name
character, optional Name of the output qsf file. Default is "output_survey". The extension qsf will be added automatically. If the desired file name is "my_qsf_output.qsf, the function should be called as generate_survey("path/to/setup/survey_setup_file.csv", "path/to/output/my_qsf_output"). Default name is "output_survey.qsf". If a file with the same name exists, it will be overwritten.
- question_text
logical, optional If TRUE, the function will use the question text provided in the csv file. If FALSE, the function will use a default question text ("Insert text here."). Default is TRUE.
Examples
# Generate survey from sample setup file
setup_file <- system.file("extdata", "sample_setup_file.csv", package = "ThinkingGrid")
if (file.exists(setup_file)) {
generate_survey(setup_file, "_temp_output_")
# Clean up
file.remove("_temp_output_-0.qsf")
}
#> [1] TRUE