form_to_json | R Documentation |
Convert a (pre)registration specification to YAML or JSON
form_to_json(x, file = NULL)
prereg_spec_to_json(x, includeFormSpec = TRUE, file = NULL)
## S3 method for class 'preregr_json'
print(x, ...)
prereg_spec_to_yaml(x, includeFormSpec = TRUE, file = NULL)
## S3 method for class 'preregr_yaml'
print(x, ...)
x |
The (pre)registration object (as produced by a call to
|
file |
Optionally, a file to save the YAML or JSON to. |
includeFormSpec |
Whether to include the (pre)registration form specification. Note that this includes metadata about the form fields such as their labels and descriptions - without the form specification, only the item identifiers are stored. |
... |
Any additional arguments are ignored. |
If a file is specified to write, to, x
will be returned invisibly
to allow building a pipe chain; if file=NULL
, the resulting YAML/JSON
will be returned as a character vector.
### Load an example (pre)registration specification
data("examplePrereg_1", package = "preregr");
### Export to YAML
preregr::prereg_spec_to_json(
examplePrereg_1
);
### Load an example (pre)registration specification
data("examplePrereg_1", package = "preregr");
### Export to YAML
preregr::prereg_spec_to_yaml(
examplePrereg_1
);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.