Skip to contents

Read metadata for a particular id. You may want to use orderly_search to find an id corresponding to a particular query.

Usage

orderly_metadata(id, root = NULL)

Arguments

id

The id to fetch metadata for. An error will be thrown if this id is not known

root

The path to the root directory, or NULL (the default) to search for one from the current working directory. This function does not require that the directory is configured for orderly, and can be any outpack root (see orderly_init for details).

Value

A list of metadata. See the outpack schema for details (https://github.com/mrc-ide/outpack)

Examples

path <- orderly_example()
#>  Created orderly root at '/tmp/Rtmp3NBL3X/orderly2_ex_1cf13bc6a920'
id <- orderly_run("data", root = path)
#>  Starting packet 'data' `20250807-155619-962638f9` at 2025-08-07 15:56:19.590974
#> > orderly_description(
#> +   display = "A demo data set")
#> > x <- jitter(1:30)
#> > y <- 0.4 * x + 5 + rnorm(length(x), sd = 2)
#> > d <- data.frame(x, y)
#> > orderly_artefact("data.rds", description = "A synthetic dataset")
#> > saveRDS(d, "data.rds")
#>  Finished running data.R
#>  Finished 20250807-155619-962638f9 at 2025-08-07 15:56:19.616273 (0.02529883 secs)

# Read metadata for this packet:
meta <- orderly_metadata(id, root = path)
names(meta)
#> [1] "schema_version" "name"           "id"             "time"          
#> [5] "parameters"     "files"          "depends"        "git"           
#> [9] "custom"        

# Information on files produced by this packet:
meta$files
#>       path size
#> 1   data.R  227
#> 2 data.rds  598
#>                                                                      hash
#> 1 sha256:64df52ebf4cfe4a1cf989f51280b22c3a6aa9aa06096afcf0a52135c704cc374
#> 2 sha256:d607577e8f76b20a3552b78f4154288602ff228b69a34da1c1e975e49075a287