List draft and archived reports. This returns a data.frame with columns name (see orderly_list()) and id.

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 if locate is TRUE.

locate

Logical, indicating if the configuration should be searched for. If TRUE and config is not given, then orderly looks in the working directory and up through its parents until it finds an orderly_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 an orderly_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 <- orderly::orderly_example("demo")

# Reports that _could_ be run:
orderly::orderly_list(path)
#>  [1] "changelog"          "connection"         "global"            
#>  [4] "html"               "interactive"        "minimal"           
#>  [7] "multi-artefact"     "multifile-artefact" "other"             
#> [10] "slow1"              "slow10"             "slow3"             
#> [13] "spaces"             "use_dependency"     "use_dependency_2"  
#> [16] "use_resource"       "use_resource_dir"   "view"              

# Run a report twice:
id1 <- orderly::orderly_run("minimal", root = path)
#> [ name       ]  minimal
#> [ id         ]  20211125-140120-b0bfc7f7
#> [ start      ]  2021-11-25 14:01:20
#> [ 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_png 
#>       2 
#> [ end        ]  2021-11-25 14:01:20
#> [ elapsed    ]  Ran report in 0.02052951 secs
#> [ artefact   ]  mygraph.png: 175369b2bcf4115f343c8ad746c0c072
id2 <- orderly::orderly_run("minimal", root = path)
#> [ name       ]  minimal
#> [ id         ]  20211125-140120-be05c44d
#> [ start      ]  2021-11-25 14:01:20
#> [ 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_png 
#>       2 
#> [ end        ]  2021-11-25 14:01:20
#> [ elapsed    ]  Ran report in 0.01441121 secs
#> [ artefact   ]  mygraph.png: 175369b2bcf4115f343c8ad746c0c072

# We can see both drafts:
orderly::orderly_list_drafts(path)
#>      name                       id
#> 1 minimal 20211125-140120-b0bfc7f7
#> 2 minimal 20211125-140120-be05c44d

# Nothing is in the archive:
orderly::orderly_list_archive(path)
#> [1] name id  
#> <0 rows> (or 0-length row.names)

# Commit a report:
orderly::orderly_commit(id2, root = path)
#> [ commit     ]  minimal/20211125-140120-be05c44d
#> [ copy       ]
#> [ import     ]  minimal:20211125-140120-be05c44d
#> [ success    ]  :)
#> [1] "/tmp/RtmpP7mCov/file4621bc92b0/archive/minimal/20211125-140120-be05c44d"

# Only one draft now
orderly::orderly_list_drafts(path)
#>      name                       id
#> 1 minimal 20211125-140120-b0bfc7f7

# And the second report is in the archive:
orderly::orderly_list_archive(path)
#>      name                       id
#> 1 minimal 20211125-140120-be05c44d