diff --git a/.buildlibrary b/.buildlibrary index 46e2c374..4f294796 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '7183116' +ValidationKey: '7208614' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d2e4ca9..7a47c414 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/lorenzwalthert/precommit - rev: v0.3.2.9019 + rev: v0.3.2.9021 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index 96086734..e58bd8a9 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'madrat: May All Data be Reproducible and Transparent (MADRaT) *' -version: 3.6.6 -date-released: '2023-09-26' +version: 3.6.7 +date-released: '2023-10-12' abstract: Provides a framework which should improve reproducibility and transparency in data processing. It provides functionality such as automatic meta data creation and management, rudimentary quality management, data caching, work-flow management diff --git a/DESCRIPTION b/DESCRIPTION index 61d027ea..5ea52d39 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: madrat Title: May All Data be Reproducible and Transparent (MADRaT) * -Version: 3.6.6 -Date: 2023-09-26 +Version: 3.6.7 +Date: 2023-10-12 Authors@R: c( person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", , "lavinia@pik-potsdam.de", role = "aut"), diff --git a/R/visualizeDependencies.R b/R/visualizeDependencies.R index 119c1ec2..9d5e106a 100644 --- a/R/visualizeDependencies.R +++ b/R/visualizeDependencies.R @@ -132,37 +132,45 @@ visualizeDependencies <- function(..., direction = "both", order = 2, filter = N V(fullGraph)$shape <- "circle" } + # make central vertices circles + V(fullGraph)$shape[V(fullGraph)$name %in% functions] <- "circle" # add corresponding mr package to each vertex of graph for (i in seq_along(V(fullGraph))) { V(fullGraph)$color[i] <- ifelse(V(fullGraph)$name[i] %in% dfGraphMadrat$from, dfGraphMadrat$from_package[which(dfGraphMadrat$from == V(fullGraph)$name[i])[1]], dfGraphMadrat$to_package[which(dfGraphMadrat$to == V(fullGraph)$name[i])[1]]) + V(fullGraph)$frame.color[i] <- V(fullGraph)$color[i] + V(fullGraph)$frame.width[i] <- 1 } # all packages that are relevant pkg <- unique(V(fullGraph)$color) # set default colors - colorsIn <- c("deepskyblue", "gold", "mediumpurple", "#33cbb9", "#219421") + colorsVertices <- c("deepskyblue", "gold", "mediumpurple", "#33cba8", "#219421", + "#ff7700", "#d52580", "#3b3bab", "#237791", "#a61818", "#8cdb7d") - # set vertex colors according to package (different shades for incoming/outgoing) + # set vertex colors according to packages for (i in seq_along(pkg)) { - V(fullGraph)$color[which(V(fullGraph)$color == pkg[i])] <- colorsIn[i] + V(fullGraph)$color[which(V(fullGraph)$color == pkg[i])] <- colorsVertices[i] + V(fullGraph)$frame.color[which(V(fullGraph)$frame.color == pkg[i])] <- colorsVertices[i] } - # make central vertices red - V(fullGraph)$color[V(fullGraph)$name %in% functions] <- "#f84141" - V(fullGraph)$shape[V(fullGraph)$name %in% functions] <- "sphere" + # for non-central vetices only frame colored + V(fullGraph)$color[!(V(fullGraph)$name %in% functions)] <- "white" + V(fullGraph)$frame.width[!(V(fullGraph)$name %in% functions)] <- 3 # plot graph if (!is.null(filename)) grDevices::png(filename, 800, 800) plot(fullGraph) - graphics::legend("topright", legend = c(pkg, "Central functions"), pch = 16, - col = c(colorsIn[seq_along(pkg)], "#c93535"), bty = "n") - if (direction == "both") graphics::legend("bottomright", legend = c("In", "Out"), pch = c(22, 21), bty = "n") - if (direction == "in") graphics::legend("bottomright", legend = c("In"), pch = 22, bty = "n") - if (direction == "out") graphics::legend("bottomright", legend = c("Out"), pch = 21, bty = "n") + graphics::legend("topright", legend = pkg, pch = 16, col = colorsVertices[seq_along(pkg)], bty = "n") + if (direction == "both") graphics::legend("bottomright", legend = c("Central functions", "In", "Out"), + pch = c(16, 22, 21), bty = "n") + if (direction == "in") graphics::legend("bottomright", legend = c("Central functions", "In"), + pch = c(16, 22), bty = "n") + if (direction == "out") graphics::legend("bottomright", legend = c("Central functions", "Out"), + pch = c(16, 21), bty = "n") if (!is.null(filename)) grDevices::dev.off() # return graph and list of relevant packages diff --git a/README.md b/README.md index 0aacb09a..f8832371 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # May All Data be Reproducible and Transparent (MADRaT) * -R package **madrat**, version **3.6.6** +R package **madrat**, version **3.6.7** [![CRAN status](https://www.r-pkg.org/badges/version/madrat)](https://cran.r-project.org/package=madrat) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1115490.svg)](https://doi.org/10.5281/zenodo.1115490) [![R build status](https://github.com/pik-piam/madrat/workflows/check/badge.svg)](https://github.com/pik-piam/madrat/actions) [![codecov](https://codecov.io/gh/pik-piam/madrat/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/madrat) [![r-universe](https://pik-piam.r-universe.dev/badges/madrat)](https://pik-piam.r-universe.dev/builds) @@ -55,7 +55,7 @@ In case of questions / problems please contact Jan Philipp Dietrich , R package version 3.6.6, . +Dietrich J, Baumstark L, Wirth S, Giannousakis A, Rodrigues R, Bodirsky B, Leip D, Kreidenweis U, Klein D, Führlich P (2023). _madrat: May All Data be Reproducible and Transparent (MADRaT)_. doi: 10.5281/zenodo.1115490 (URL: https://doi.org/10.5281/zenodo.1115490), R package version 3.6.7, . A BibTeX entry for LaTeX users is @@ -64,7 +64,7 @@ A BibTeX entry for LaTeX users is title = {madrat: May All Data be Reproducible and Transparent (MADRaT)}, author = {Jan Philipp Dietrich and Lavinia Baumstark and Stephen Wirth and Anastasis Giannousakis and Renato Rodrigues and Benjamin Leon Bodirsky and Debbora Leip and Ulrich Kreidenweis and David Klein and Pascal Führlich}, year = {2023}, - note = {R package version 3.6.6}, + note = {R package version 3.6.7}, doi = {10.5281/zenodo.1115490}, url = {https://github.com/pik-piam/madrat}, }