orderly
From the mrc-ide r-universe (recommended)
From GitHub using remotes
:
From PyPi (for Python)
There is a discussion to have here about naming. We might have this in a break…
First, load the package and create a new empty orderly root.
library(orderly)
orderly_init("workdir/part1")
## ✔ Created orderly root at '/home/runner/work/orderly-tutorial/orderly-tutorial/workdir/part1'
## Warning: Can't check if files are correctly gitignored
## ℹ Your outpack repo is in a subdirectory ''workdir/part1'' of your git repo
## ℹ To disable this check, set the option 'orderly_git_error_ignore' to TRUE by
## running `options(orderly_git_error_ignore = TRUE)`
(for the rest of this section, we have setwd()
into this directory; you should create an RStudio “Project” here.)
orderly_new("example")
## Warning: Can't check if files are correctly gitignored
## ℹ Your outpack repo is in a subdirectory ''workdir/part1'' of your git repo
## ℹ To disable this check, set the option 'orderly_git_error_ignore' to TRUE by
## running `options(orderly_git_error_ignore = TRUE)`
## ✔ Created 'src/example/example.R'
We have edited src/example/example.R
to contain:
Now we run
id <- orderly_run("example")
## Warning: Can't check if files are correctly gitignored
## ℹ Your outpack repo is in a subdirectory ''workdir/part1'' of your git repo
## ℹ To disable this check, set the option 'orderly_git_error_ignore' to TRUE by
## running `options(orderly_git_error_ignore = TRUE)`
## ℹ Starting packet 'example' `20250917-102537-37e9fc6c` at 2025-09-17 10:25:37.226443
## > d <- data.frame(greeting = "hello", to = "world")
## > write.csv(d, "hello.csv", row.names = FALSE)
## ✔ Finished running 'example.R'
## ℹ Finished 20250917-102537-37e9fc6c at 2025-09-17 10:25:37.279844 (0.05340075 secs)
archive/example
)example.R
into the directoryContents of hello.csv
:
and a bunch of metadata:
orderly_metadata(id)
## Warning: Can't check if files are correctly gitignored
## ℹ Your outpack repo is in a subdirectory ''workdir/part1'' of your git repo
## ℹ To disable this check, set the option 'orderly_git_error_ignore' to TRUE by
## running `options(orderly_git_error_ignore = TRUE)`
## $schema_version
## [1] "0.1.1"
##
## $name
## [1] "example"
##
## $id
## [1] "20250917-102537-37e9fc6c"
##
## $time
## $time$start
## [1] "2025-09-17 10:25:37 UTC"
##
## $time$end
## [1] "2025-09-17 10:25:37 UTC"
##
##
## $parameters
## NULL
##
## $files
## path size
## 1 example.R 95
## 2 hello.csv 32
## hash
## 1 sha256:541682d8b8dba9b2ddb4ac5809c03e6bedd58b52ab3e64a662f3f48e66a9639f
## 2 sha256:b9f0704f459f7ad9785ddee01a281d81f95a461dbb682436a263e0b7252e92b7
##
## $depends
## [1] packet query files
## <0 rows> (or 0-length row.names)
##
## $git
## $git$sha
## [1] "e30a08fdf13c3b52d69970a09aac0636d39901c9"
##
## $git$branch
## [1] "main"
##
## $git$url
## [1] "https://github.com/mrc-ide/orderly-tutorial"
##
##
## $custom
## $custom$orderly
## $custom$orderly$artefacts
## [1] description paths
## <0 rows> (or 0-length row.names)
##
## $custom$orderly$role
## path role
## 1 example.R orderly
##
## $custom$orderly$description
## $custom$orderly$description$display
## NULL
##
## $custom$orderly$description$long
## NULL
##
## $custom$orderly$description$custom
## NULL
##
##
## $custom$orderly$shared
## [1] here there
## <0 rows> (or 0-length row.names)
##
## $custom$orderly$session
## $custom$orderly$session$platform
## $custom$orderly$session$platform$version
## [1] "R version 4.5.1 (2025-06-13)"
##
## $custom$orderly$session$platform$os
## [1] "Ubuntu 24.04.3 LTS"
##
## $custom$orderly$session$platform$system
## [1] "x86_64, linux-gnu"
##
##
## $custom$orderly$session$packages
## package version attached
## 1 orderly 1.99.85 TRUE
## 2 crayon 1.5.3 FALSE
## 3 vctrs 0.6.5 FALSE
## 4 cli 3.6.5 FALSE
## 5 knitr 1.50 FALSE
## 6 rlang 1.1.6 FALSE
## 7 xfun 0.53 FALSE
## 8 jsonlite 2.0.0 FALSE
## 9 glue 1.8.0 FALSE
## 10 openssl 2.3.3 FALSE
## 11 askpass 1.2.1 FALSE
## 12 htmltools 0.5.8.1 FALSE
## 13 sys 3.4.3 FALSE
## 14 rmarkdown 2.29 FALSE
## 15 evaluate 1.0.5 FALSE
## 16 tibble 3.3.0 FALSE
## 17 fastmap 1.2.0 FALSE
## 18 yaml 2.3.10 FALSE
## 19 lifecycle 1.0.4 FALSE
## 20 compiler 4.5.1 FALSE
## 21 fs 1.6.6 FALSE
## 22 pkgconfig 2.0.3 FALSE
## 23 digest 0.6.37 FALSE
## 24 gert 2.1.5 FALSE
## 25 R6 2.6.1 FALSE
## 26 pillar 1.11.0 FALSE
## 27 credentials 2.0.3 FALSE
## 28 magrittr 2.0.4 FALSE
## 29 withr 3.0.2 FALSE
## 30 tools 4.5.1 FALSE
A one-way transformation from data to a fairly short string
Very small changes to the string give large changes to the hash
This means we can compare hashes and be confident we are looking at the same file (git
does a lot of this)
orderly_run("example")
## Warning: Can't check if files are correctly gitignored
## ℹ Your outpack repo is in a subdirectory ''workdir/part1'' of your git repo
## ℹ To disable this check, set the option 'orderly_git_error_ignore' to TRUE by
## running `options(orderly_git_error_ignore = TRUE)`
## ℹ Starting packet 'example' `20250917-102537-6665cadd` at 2025-09-17 10:25:37.404701
## > d <- data.frame(greeting = "hello", to = "world")
## > write.csv(d, "hello.csv", row.names = FALSE)
## ✔ Finished running 'example.R'
## ℹ Finished 20250917-102537-6665cadd at 2025-09-17 10:25:37.432273 (0.02757215 secs)
## [1] "20250917-102537-6665cadd"
Stop naming files data_final-rgf (2).csv
, please
fs::dir_tree("workdir/part1")
## workdir/part1
## ├── archive
## │ └── example
## │ ├── 20250917-102537-37e9fc6c
## │ │ ├── example.R
## │ │ └── hello.csv
## │ └── 20250917-102537-6665cadd
## │ ├── example.R
## │ └── hello.csv
## ├── draft
## │ └── example
## ├── orderly_config.yml
## └── src
## └── example
## └── example.R
orderly_metadata_extract()
## Warning: Can't check if files are correctly gitignored
## ℹ Your outpack repo is in a subdirectory ''workdir/part1'' of your git repo
## ℹ To disable this check, set the option 'orderly_git_error_ignore' to TRUE by
## running `options(orderly_git_error_ignore = TRUE)`
## id name parameters
## 1 20250917-102537-37e9fc6c example
## 2 20250917-102537-6665cadd example