diff --git a/.Rbuildignore b/.Rbuildignore index 201cfbc..63b5ccf 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ ^docs$ ^pkgdown$ ^\.github$ +^Makefile$ +^\.lintr$ diff --git a/DESCRIPTION b/DESCRIPTION index e730d41..8b6677a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,15 +18,14 @@ Depends: Imports: dagitty, DiagrammeR, - DiagrammeRsvg, dplyr, htmlTable, knitr, magrittr, messaging, purrr, - rsvg, + rlang, stringr, tibble Encoding: UTF-8 -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 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" +)) 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, ...) diff --git a/R/qd_swig.R b/R/qd_swig.R index 19f6fe0..de57c08 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() #' @@ -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) { 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, 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} }