knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
(Pre)registration forms can be directly imported from an URL. For example, the vignette about how to create a preregistration form stores the two forms embedded as JSON. These can be imported again as a preregr
form.
importedExample <- preregr::import_from_html( "https://preregr.opens.science/articles/creating_prereg_form.html" );
This imports the first form, the example that is created in that vignette:
importedExample;
Or, to view the form:
preregr::form_show(importedExample);
We can now initialize a new (pre)registration using this form:
freshPrereg <- preregr::prereg_initialize( importedExample );
Et voila, an empty (pre)registration:
freshPrereg;
To import the second form that is embedded in that vignette (the full form for systematic reviews), we can pass a value for select
:
importedExample_2 <- preregr::import_from_html( "https://preregr.opens.science/articles/creating_prereg_form.html", select = 2 );
If we now knit this form into this vignette again, it will again be included as JSON as well:
preregr::form_knit(importedExample);
Alternatively, you can export the form to a local spreadsheet file so you can import it later:
preregr::form_to_xlsx( formExample, file = "C:/Data/Research/amazing-new-project/prereg-form.xlsx" );
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.