R/insert_protocolsection.R
insert_protocolsection.Rd
The idea is to execute this function in an R chunk with knitr
option results="asis"
.
insert_protocolsection(
code_subprotocol,
version_number,
file_name,
section = NULL,
demote_header = c(0, 1, 2, -1),
fetch_remote = TRUE
)
Character string giving the protocol code from
which a sub-protocol will be made (usually a sfp
-type protocol)
Character string with format YYYY.NN
Character string with the name of the Rmarkdown file (a chapter starting with a level 1 heading).
Optional character string with the name of a section within an Rmarkdown file. Can also be a unique substring of a section title. If not specified (the default): the whole file is taken. It is assumed that the section has a level 2 heading.
Number of '#' to prefix to all titles before inserting in current protocol. Default is 0. A negative value can be used to remove '#' from all section titles. Allowed values are visible in the usage section.
Whether or not to fetch the remote. Default TRUE.
The function will return Rmarkdown
Other creation:
add_dependencies()
,
add_one_subprotocol()
,
add_subprotocols()
,
create_protocol()
,
update_protocol()
,
update_version_number()
if (FALSE) { # \dontrun{
insert_protocolsection(
code_subprotocol = "sfp-401-nl",
version_number = "2021.01",
file_name = "07_stappenplan.Rmd"
)
} # }