Skip to content

Commit a588484

Browse files
authored
Merge pull request #326 from vimc/vimc-7040
add orderly_packages method
2 parents 14f7477 + d17c640 commit a588484

File tree

21 files changed

+137
-32
lines changed

21 files changed

+137
-32
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: orderly
22
Title: Lightweight Reproducible Reporting
3-
Version: 1.5.1
3+
Version: 1.6.0
44
Description: Order, create and store reports from R. By defining a
55
lightweight interface around the inputs and outputs of an
66
analysis, a lot of the repetitive work for reproducible research
@@ -46,7 +46,7 @@ Suggests:
4646
rmarkdown,
4747
testthat,
4848
vaultr (>= 1.0.4)
49-
RoxygenNote: 7.2.0
49+
RoxygenNote: 7.2.3
5050
Roxygen: list(markdown = TRUE)
5151
VignetteBuilder: knitr
5252
Language: en-GB

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export(orderly_log_off)
3535
export(orderly_log_on)
3636
export(orderly_migrate)
3737
export(orderly_new)
38+
export(orderly_packages)
3839
export(orderly_pull_archive)
3940
export(orderly_pull_dependencies)
4041
export(orderly_push_archive)

R/info.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,21 @@ orderly_info <- function(id, name, root = NULL, locate = TRUE) {
7171
error = error
7272
)
7373
}
74+
75+
##' Return details of packages required by all src reports in this orderly repo
76+
##'
77+
##' @inheritParams orderly_list
78+
##'
79+
##' @return List of packages required by all src reports
80+
##' @export
81+
##'
82+
##' @examples
83+
##' path <- orderly::orderly_example("minimal")
84+
##' orderly::orderly_packages(root = path)
85+
orderly_packages <- function(root = NULL, locate = TRUE) {
86+
cfg <- orderly_config(root, locate)
87+
names <- basename(list_dirs(path_src(cfg$root)))
88+
packages <- lapply(names,
89+
function(name) orderly_recipe$new(name, cfg)$packages)
90+
unique(as.list(unlist(packages)))
91+
}

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ reference:
9999
contents:
100100
- orderly_example
101101
- orderly_run_info
102+
- orderly_packages
102103
- orderly_log
103104
- orderly_log_off
104105
- orderly_log_on

inst/examples/minimal/src/example/orderly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ artefacts:
66
staticgraph:
77
description: A graph of things
88
filenames: mygraph.png
9+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
data:
2+
dat:
3+
query: SELECT name, number FROM thing
4+
script: script.R
5+
artefacts:
6+
staticgraph:
7+
description: A graph of things
8+
filenames: mygraph.png
9+
packages:
10+
- withr
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
png("mygraph.png")
2+
par(mar = c(15, 4, .5, .5))
3+
barplot(setNames(dat$number, dat$name), las = 2)
4+
dev.off()

man/orderly_config.Rd

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/orderly_log.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/orderly_packages.Rd

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)