R/prereg_specify.R
prereg_specify.Rd
Specify the content for one or more (pre)registration items
prereg_specify(
x,
...,
append = TRUE,
validate = TRUE,
requireValidContent = TRUE,
silent = preregr::opts$get("silent")
)
The (pre)registration object (as produced by a call to
prereg_initialize()
).
Item-content pairings.
Whether to replace (append=FALSE
) or append (append=TRUE
)
the content if an item already contains some content.
Whether to validate the specified content for each item using the validation rules in the (pre)registration form.
Whether to only store new content if it passes
validation. Note that this is ignored if validate=FALSE
.
Whether to be silent or chatty.
x, invisibly
### Load an example (pre)registration specification
data("examplePrereg_1", package = "preregr");
### Specify some fields and show the results
examplePrereg_1 |>
preregr::prereg_specify(
tasks_and_roles = "All authors contributed equally",
nonExistent_item = "This can't be stored anywhere",
start_date = "2021-9-01"
) |>
preregr::prereg_show_item_completion(
section="metadata"
);
#>
#> ── Specifying content for (pre)registration items ──────────────────────────────
#> ! You specified content for item 'nonExistent_item', but this item does not exist in the prereg form specification that you initialized (Inclusive General-Purpose Registration Form). Ignoring these items.
#> ✔ Content specified for item Tasks and roles passed validation!
#> ✔ Specified content for Tasks and roles [tasks_and_roles]
#> ! Item Start date did not pass validation: The specified date does not conform to the ISO 8601 standard (YYYY-MM-DD)..
#> ✖ The content you specified for Start date [start_date] failed to pass validation with message 'The specified date does not conform to the ISO 8601 standard (YYYY-MM-DD).', so did not set it.
#>
#> ── Items in (pre)registration specification ────────────────────────────────────
#>
#> ℹ Form: Inclusive General-Purpose Registration Form
#> ℹ Version: 1.1
#>
#> ── Section: Metadata ──
#>
#> ✔ Discipline [discipline]
#> ✔ Title [title]
#> ✔ Author(s) / contributor(s) [authors]
#> ✔ Tasks and roles [tasks_and_roles]
#> ✖ Funding [funding]
#> ✖ Conflicts of interest [cois]