sd_add_question {surveydown} | R Documentation |
This function inserts a template for a surveydown question at the current cursor position in the active RStudio document. It supports various question types and automatically removes the function call before inserting the template if it exists in the document.
sd_add_question(type = "mc", chunk = FALSE)
type |
A character string specifying the type of question template to
insert.
Default is
|
chunk |
Logical. If |
The function performs the following steps:
Checks for and removes any existing sd_add_question()
function call in the document.
Inserts the appropriate question template at the current cursor position.
This function does not return a value. It modifies the active document as a side effect by inserting text and potentially removing a function call.
if (interactive()) {
library(surveydown)
# Insert a default multiple choice question template
sd_add_question()
# Insert a text input question template
sd_add_question("text")
# Insert a slider question template
sd_add_question("slider")
}