From 456a10bcd3b364b52074402347460bea13264b64 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:26:46 +0100 Subject: [PATCH 01/10] Amend . to _ in argument names in example --- R/qd_swig.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/qd_swig.R b/R/qd_swig.R index 19f6fe0..2cb2542 100644 --- a/R/qd_swig.R +++ b/R/qd_swig.R @@ -25,8 +25,8 @@ #' dag <- qd_dag(edges) #' #' swig <- dag %>% -#' qd_swig(fixed.nodes = "A", -#' custom.values = c("A" = "1")) +#' qd_swig(fixed_nodes = "A", +#' custom_values = c("A" = "1")) #' #' swig %>% DiagrammeR::render_graph() #' From 4171fe1e9e00f015a3e6303474a490fc5691cea5 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:28:52 +0100 Subject: [PATCH 02/10] Update .Rbuildignore --- .Rbuildignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.Rbuildignore b/.Rbuildignore index 201cfbc..63b5ccf 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ ^docs$ ^pkgdown$ ^\.github$ +^Makefile$ +^\.lintr$ From 4e4e894cd11b47417622ae1e436eba44caee4dec Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:30:02 +0100 Subject: [PATCH 03/10] Amend curr.id to curr_id --- R/qd_swig.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/qd_swig.R b/R/qd_swig.R index 2cb2542..de57c08 100644 --- a/R/qd_swig.R +++ b/R/qd_swig.R @@ -48,7 +48,7 @@ qd_swig <- function(graph_obj, # map() set up to drop the destination node ancestors <- DiagrammeR::get_paths(graph_obj, to = curr_id) %>% - purrr::map(~ .x[.x != curr.id]) + purrr::map(~ .x[.x != curr_id]) fx_nodes <- ancestors %>% purrr::map(function(x) { From f0c195002e5d54cc9f71acc6f6d24cedb72ee786 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:32:02 +0100 Subject: [PATCH 04/10] Add rlang to Imports --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index e730d41..e15db66 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,6 +25,7 @@ Imports: magrittr, messaging, purrr, + rlang, rsvg, stringr, tibble From a094059a1208435a161506d61d55587426ca45a5 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:33:05 +0100 Subject: [PATCH 05/10] Remove DiagrammeRsvg and rsvg --- DESCRIPTION | 2 -- 1 file changed, 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e15db66..3f5dbd7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,6 @@ Depends: Imports: dagitty, DiagrammeR, - DiagrammeRsvg, dplyr, htmlTable, knitr, @@ -26,7 +25,6 @@ Imports: messaging, purrr, rlang, - rsvg, stringr, tibble Encoding: UTF-8 From af6a8903809ffa044bb19b9db493f001e20937d2 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:35:48 +0100 Subject: [PATCH 06/10] Amend sep.opts to sep_opts --- R/sep_opts.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/sep_opts.R b/R/sep_opts.R index eb3e4a5..39b8ccb 100644 --- a/R/sep_opts.R +++ b/R/sep_opts.R @@ -18,8 +18,8 @@ sep_opts <- function(table = FALSE) { "bracks" = "][", "rangle" = "⟩") if (table == TRUE) { - char_tab <- tibble::tibble(separator = names(sep.opts), - result = unname(sep.opts)) + char_tab <- tibble::tibble(separator = names(sep_opts), + result = unname(sep_opts)) print( htmlTable::htmlTable( char_tab, From 46910e998f21ea66e6369f41906ae7740501ee89 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:39:37 +0100 Subject: [PATCH 07/10] Add \dontrun to avoid creating dag.pdf during devtools::check() --- R/qd_save.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/qd_save.R b/R/qd_save.R index 4446c77..74e135b 100644 --- a/R/qd_save.R +++ b/R/qd_save.R @@ -17,6 +17,7 @@ #' @rdname qd_save #' @export #' @examples +#' \dontrun{ #' dag <- qd_dag(c("L -> {A Y}", "A -> Y")) #' qd_save(dag, "dag.pdf") #' @@ -25,6 +26,7 @@ #' #' # `title` passed to DiagrammeR::export_graph() #' qd_save(dag, "dag.pdf", title = "Demo") +#' } qd_save <- function(graph, file_name, ..., embed = FALSE, kg = NULL) { DiagrammeR::export_graph(graph = graph, file_name = file_name, ...) From c7f7ecd9e4fb21a402d753772ba654c889c203d3 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Wed, 3 Sep 2025 10:27:06 +0100 Subject: [PATCH 08/10] devtools::document() --- man/qd_save.Rd | 2 ++ man/qd_swig.Rd | 4 ++-- man/quickdag-package.Rd | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/man/qd_save.Rd b/man/qd_save.Rd index 0492701..aa55823 100644 --- a/man/qd_save.Rd +++ b/man/qd_save.Rd @@ -27,6 +27,7 @@ For convenience in computational notebooks like quarto or RMarkdown documents, [qd_save()] also allows the user to embed the image via [knitr::include_graphics()]. } \examples{ +\dontrun{ dag <- qd_dag(c("L -> {A Y}", "A -> Y")) qd_save(dag, "dag.pdf") @@ -36,3 +37,4 @@ qd_save(dag, "dag.pdf", embed = TRUE) # `title` passed to DiagrammeR::export_graph() qd_save(dag, "dag.pdf", title = "Demo") } +} diff --git a/man/qd_swig.Rd b/man/qd_swig.Rd index 1be7c77..9b7968e 100644 --- a/man/qd_swig.Rd +++ b/man/qd_swig.Rd @@ -41,8 +41,8 @@ edges <- c("A -> Y", dag <- qd_dag(edges) swig <- dag \%>\% - qd_swig(fixed.nodes = "A", - custom.values = c("A" = "1")) + qd_swig(fixed_nodes = "A", + custom_values = c("A" = "1")) swig \%>\% DiagrammeR::render_graph() diff --git a/man/quickdag-package.Rd b/man/quickdag-package.Rd index 5dd8886..b7603b7 100644 --- a/man/quickdag-package.Rd +++ b/man/quickdag-package.Rd @@ -12,6 +12,7 @@ This package allows the user the save directed acyclic graphs (DAGs) generated i Useful links: \itemize{ \item \url{https://github.com/jrgant/quickDAG} + \item \url{https://jrgant.github.io/quickdag/} \item Report bugs at \url{https://github.com/jrgant/quickDAG/issues} } From 4b194596e965e9dc703fb6cc5a5ddfd2aa9a445b Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 4 Sep 2025 06:15:50 +0100 Subject: [PATCH 09/10] Define globals to suppress check note --- R/globals.R | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 R/globals.R diff --git a/R/globals.R b/R/globals.R new file mode 100644 index 0000000..3ecbd80 --- /dev/null +++ b/R/globals.R @@ -0,0 +1,4 @@ +utils::globalVariables(c( + "alpha_id", + "label" +)) From 136ffd416fb764cb82f63eaa900de3a66d32102d Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 4 Sep 2025 06:15:59 +0100 Subject: [PATCH 10/10] Bump roxygen2 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3f5dbd7..8b6677a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,4 +28,4 @@ Imports: stringr, tibble Encoding: UTF-8 -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3