Function to add a chapter or a section of a published protocol for re-use in another protocol
Source:R/insert_protocolsection.R
insert_protocolsection.Rd
The idea is to execute this function in an R chunk with knitr
option results="asis"
.
Usage
insert_protocolsection(
code_subprotocol,
version_number,
file_name,
section = NULL,
demote_header = c(0, 1, 2, -1),
fetch_remote = TRUE
)
Arguments
- code_subprotocol
Character string giving the protocol code from which a sub-protocol will be made (usually a
sfp
-type protocol)- version_number
Character string with format
YYYY.NN
- file_name
Character string with the name of the Rmarkdown file (a chapter starting with a level 1 heading).
- section
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.
- demote_header
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.
- fetch_remote
Whether or not to fetch the remote. Default TRUE.
See also
Other creation:
add_dependencies()
,
add_one_subprotocol()
,
add_subprotocols()
,
create_protocol()
,
update_protocol()
,
update_version_number()