List draft and archived reports. This returns a data.frame with
columns name
(see orderly_list()
) and id
.
Usage
orderly_list_drafts(root = NULL, locate = TRUE, include_failed = FALSE)
orderly_list_archive(root = NULL, locate = TRUE)
Arguments
- root
The path to an orderly root directory, or
NULL
(the default) to search for one from the current working directory iflocate
isTRUE
.- locate
Logical, indicating if the configuration should be searched for. If
TRUE
andconfig
is not given, then orderly looks in the working directory and up through its parents until it finds anorderly_config.yml
file.- include_failed
Logical, indicating if failed drafts should be listed (only has an effect for
orderly_list_drafts
as no failed run should make it into the archive). A failed report is one that lacks anorderly_run.rds
file.
Value
A data.frame
with columns name
and
id
, containing character vectors of report names and
versions, respectively.
See also
orderly_list()
, which lists the names of
source reports that can be run, and orderly_latest()
which returns the id of the most recent report.
Examples
# The orderly demo, with lots of potential reports:
path <- orderly1::orderly_example("demo")
# Reports that _could_ be run:
orderly1::orderly_list(path)
#> [1] "changelog" "connection" "default-param"
#> [4] "global" "html" "interactive"
#> [7] "minimal" "multi-artefact" "multifile-artefact"
#> [10] "other" "slow1" "slow10"
#> [13] "slow3" "spaces" "use_dependency"
#> [16] "use_dependency_2" "use_resource" "use_resource_dir"
#> [19] "view"
# Run a report twice:
id1 <- orderly1::orderly_run("minimal", root = path)
#> [ name ] minimal
#> [ id ] 20250731-134547-c9f2dece
#> [ start ] 2025-07-31 13:45:47.791219
#> [ data ] source => dat: 20 x 2
#>
#> > png("mygraph.png")
#>
#> > par(mar = c(15, 4, 0.5, 0.5))
#>
#> > barplot(setNames(dat$number, dat$name), las = 2)
#>
#> > dev.off()
#> agg_record_562870578
#> 2
#> [ end ] 2025-07-31 13:45:47.809743
#> [ elapsed ] Ran report in 0.01852393 secs
#> [ artefact ] mygraph.png: a7b94ccda59d3cdc6de2c3b088822f33
id2 <- orderly1::orderly_run("minimal", root = path)
#> [ name ] minimal
#> [ id ] 20250731-134547-d5ba4b0a
#> [ start ] 2025-07-31 13:45:47.837176
#> [ data ] source => dat: 20 x 2
#>
#> > png("mygraph.png")
#>
#> > par(mar = c(15, 4, 0.5, 0.5))
#>
#> > barplot(setNames(dat$number, dat$name), las = 2)
#>
#> > dev.off()
#> agg_record_562870578
#> 2
#> [ end ] 2025-07-31 13:45:47.855597
#> [ elapsed ] Ran report in 0.0184207 secs
#> [ artefact ] mygraph.png: a7b94ccda59d3cdc6de2c3b088822f33
# We can see both drafts:
orderly1::orderly_list_drafts(path)
#> name id
#> 1 minimal 20250731-134547-c9f2dece
#> 2 minimal 20250731-134547-d5ba4b0a
# Nothing is in the archive:
orderly1::orderly_list_archive(path)
#> [1] name id
#> <0 rows> (or 0-length row.names)
# Commit a report:
orderly1::orderly_commit(id2, root = path)
#> [ commit ] minimal/20250731-134547-d5ba4b0a
#> [ copy ]
#> [ import ] minimal:20250731-134547-d5ba4b0a
#> [ success ] :)
#> [1] "/tmp/Rtmp82yBdj/file1cbf1aa2415c/archive/minimal/20250731-134547-d5ba4b0a"
# Only one draft now
orderly1::orderly_list_drafts(path)
#> name id
#> 1 minimal 20250731-134547-c9f2dece
# And the second report is in the archive:
orderly1::orderly_list_archive(path)
#> name id
#> 1 minimal 20250731-134547-d5ba4b0a