orderly_latest {orderly} | R Documentation |
Find most recent report
Description
Find most recent version of an orderly report. The most recent report is always the most recently run report that has been committed (regardless of the order in which they were committed).
Usage
orderly_latest(
name = NULL,
root = NULL,
locate = TRUE,
draft = FALSE,
must_work = TRUE
)
Arguments
name |
Name of the report to find; if |
root |
The path to an orderly root directory, or |
locate |
Logical, indicating if the configuration should be
searched for. If |
draft |
Should draft reports be used searched? Valid values
are logical ( |
must_work |
Throw an error if no report is found. If |
Value
A character string with the id of the most recent report
See Also
orderly_list and orderly_list_archive for listing report names and versions.
Examples
path <- orderly::orderly_example("minimal")
id1 <- orderly::orderly_run("example", root = path, echo = FALSE)
id2 <- orderly::orderly_run("example", root = path, echo = FALSE)
# With no reports committed there is no latest report:
orderly::orderly_latest("example", root = path, must_work = FALSE)
# Commit the first report and it will be reported as latest:
orderly::orderly_commit(id1, root = path)
orderly::orderly_latest("example", root = path)
# Commit the second report and it will be reported as latest instead:
orderly::orderly_commit(id2, root = path)
orderly::orderly_latest("example", root = path)