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(template = "default", path = getwd(), ask = TRUE)
Arguments
template |
A character string specifying the template to use. Default is "default" which uses the built-in package template. Other options include:
|
path |
A character string specifying the directory where the survey template should be created. Defaults to the current working directory. |
ask |
Logical. If |
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 with the "question_types" template in the "my_survey" directory
sd_create_survey(template = "question_types", path = "my_survey")
# Create a survey using the default template in the "my_survey" directory
sd_create_survey(path = "my_survey")
# Create a survey with default template in current directory
sd_create_survey("default")
# Create a survey without asking for confirmation
sd_create_survey(template = "default", path = "my_survey", ask = FALSE)
}