Skip to contents

Fetch information about the actively running report. This allows you to reflect information about your report back as part of the report, for example embedding the current report id, or information about computed dependencies. This information is in a slightly different format to orderly version 1.x and does not (currently) include information about dependencies when run outside of orderly_run, but this was never reliable previously.

Usage

orderly_run_info()

Value

A list with elements

  • name: The name of the current report

  • id: The id of the current report, NA if running interactively

  • root: The orderly root path

  • depends: A data frame with information about the dependencies (not available interactively)

    • index: an integer sequence along calls to orderly_dependency

    • name: the name of the dependency

    • query: the query used to find the dependency

    • id: the computed id of the included packet

    • filename: the file used from the packet

    • as: the filename used locally

Examples

# An example from the orderly examples
orderly_example_show("run_info")
#> 
#> ── src/run_info/run_info.R ─────────────────────────────────────────────────────
#> orderly_dependency("data", "latest", c("xy.rds" = "data.rds"))
#> xy <- readRDS("xy.rds")
#>  
#> info <- orderly_run_info()
#> print(info)
#>  
#> orderly_artefact("plot.png", description = "A plot of data")
#> png("plot.png")
#> plot(xy)
#> dev.off()

# Prepare to run
path <- orderly_example()
#>  Created orderly root at '/tmp/Rtmp3NBL3X/orderly2_ex_1cf110e708ee'
orderly_run("data", root = path, echo = FALSE)
#>  Starting packet 'data' `20250807-155626-c7b8dd7f` at 2025-08-07 15:56:26.784708
#>  Finished running data.R
#>  Finished 20250807-155626-c7b8dd7f at 2025-08-07 15:56:26.814682 (0.02997398 secs)
#> [1] "20250807-155626-c7b8dd7f"

# Here, see the printed information from a real running report
orderly_run("run_info", root = path)
#>  Starting packet 'run_info' `20250807-155626-d59a77e4` at 2025-08-07 15:56:26.838829
#> > orderly_dependency("data", "latest", c("xy.rds" = "data.rds"))
#>  Depending on data @ `20250807-155626-c7b8dd7f` (via latest(name == "data"))
#> > xy <- readRDS("xy.rds")
#> > info <- orderly_run_info()
#> > print(info)
#> $name
#> [1] "run_info"
#> 
#> $id
#> [1] "20250807-155626-d59a77e4"
#> 
#> $root
#> [1] "/tmp/Rtmp3NBL3X/orderly2_ex_1cf110e708ee"
#> 
#> $depends
#>   index name                  query                       id    there   here
#> 1     1 data latest(name == "data") 20250807-155626-c7b8dd7f data.rds xy.rds
#> 
#> > orderly_artefact("plot.png", description = "A plot of data")
#> > png("plot.png")
#> > plot(xy)
#> > dev.off()
#> agg_record_894944129 
#>                    2 
#>  Finished running run_info.R
#>  Finished 20250807-155626-d59a77e4 at 2025-08-07 15:56:26.899077 (0.0602479 secs)
#> [1] "20250807-155626-d59a77e4"