sd_create_survey {surveydown} | R Documentation |
Create a new survey template
Description
This function creates a new survey template by copying template files to the specified directory. You can choose from various predefined templates, including the default built-in template and specialized templates from the surveydown-dev/templates repository.
Usage
sd_create_survey(path = getwd(), template = "default")
Arguments
path |
A character string specifying the directory where the survey template should be created. Defaults to the current working directory. |
template |
A character string specifying the template to use. Default is "default" which uses the built-in package template. Other options include:
|
Details
When creating a new survey template, this function will:
Check if the specified template is valid
Confirm the destination path with the user (if it's the current directory)
Download template files from GitHub if a non-default template is specified
Copy template files to the destination directory
Skip .Rproj files if one already exists in the destination
Prompt for confirmation before overwriting existing files
External templates are downloaded from the surveydown-dev/templates GitHub repository.
Value
Invisible NULL
. The function is called for its side effects.
Examples
if (interactive()) {
# Create a survey using the default template
sd_create_survey(path = "my_survey")
# Create a survey with the question_types template
sd_create_survey(path = "question_demo", template = "question_types")
# Create a conditional display survey template
sd_create_survey(path = "conditional_survey", template = "conditional_display")
}