View source: R/nettskjema_get_form.R
nettskjema_get_extra | R Documentation |
The answers in the nettskjema forms have some extra information attached that is not returned by default. This is for instance information on the order of the answer options, the true text, whether the answer is correct or if it is preselected. This function makes it possible to retrieve and add this information to the nettskjema data, using the codebook.
nettskjema_get_extra(data, codebook, information, use_codebook = TRUE, ...)
data |
tibble. Data retrieved from nettskjema |
codebook |
codebook object retrieved by |
information |
character vector of information to add. One or more of "order", "option", "correct" "preselected". |
use_codebook |
logical. Use codebook for retrieving answers (default TRUE). If you have not set up the codebook in nettskjema, then turning this off will return the data as is. |
... |
arguments passed to |
tibble with added columns
## Not run:
form_id <- 100000
my_data <- nettskjema_get_data(form_id)
cb <- nettskjema_get_codebook(form_id)
my_data <- nettskjema_get_extra(my_data, cb, "order")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.