form_to_rmd_template | R Documentation |
This function creates an R Markdown template from a preregr (pre)registrations form specification. Pass it the URL to a Google Sheet holding the (pre)registration form specification (in preregr format), see the "Creating a form from a spreadsheet" vignette), the path to a file with a spreadsheet holding such a specification, or a loaded or imported preregr (pre)registration form.
form_to_rmd_template( x, file = NULL, title = NULL, author = NULL, date = "`r format(Sys.time(), \"%H:%M:%S on %Y-%m-%d %Z (UTC%z)\")`", output = "html_document", yaml = list(title = title, author = author, date = date, output = output), includeYAML = TRUE, chunkOpts = "echo=FALSE, results='hide'", justify = FALSE, headingLevel = 1, showSpecification = FALSE, preventOverwriting = rock::opts$get("preventOverwriting"), silent = rock::opts$get("silent") )
x |
The (pre)registration form (as produced by a call
to |
file |
Optionally, a file to save the html to. |
title |
The title to specify in the template's YAML front matter. |
author |
The author to specify in the template's YAML front matter. |
date |
The date to specify in the template's YAML front matter. |
output |
The output format to specify in the template's YAML front matter. |
yaml |
It is also possible to specify the YAML front matter directly
using this argument. If used, it overrides anything specified in |
includeYAML |
Whether to include the YAML front matter or omit it. |
chunkOpts |
The chunk options to set for the chunks in the template. |
justify |
Whether to use |
headingLevel |
The level of the top-most heading to use (the title of the (pre)registration form). |
showSpecification |
Whether to show the specification in the Rmd
output. When |
preventOverwriting |
Set to |
silent |
Whether to be silent or chatty. |
x, invisibly
preregr::form_create( title = "Example form", version = "0.1.0" ) |> preregr::form_to_rmd_template();
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.