diff --git a/diagrams/sdm-process.mmd b/diagrams/sdm-process.mmd index 81db55f..ff43932 100644 --- a/diagrams/sdm-process.mmd +++ b/diagrams/sdm-process.mmd @@ -1,4 +1,4 @@ -flowchart TD +flowchart LR %% nodes P(presence):::in @@ -18,6 +18,10 @@ flowchart TD N[["new data"]]:::in prd(prediction):::out prf(performance):::out + res[result set]:::out + ens[ensemble]:::fxn + der[derived]:::out + web[web]:::out %% edges P --> pts @@ -38,6 +42,44 @@ flowchart TD M --> E pr --> prd E --> prf + prd --> res + prf --> res + res --x ens + ens --> der + der --> web + res --> web + + %% subgraphs + subgraph Share + direction LR + subgraph Combine + subgraph Prepare + P + A + pts + env + X + D + end + subgraph Model + S + t1 + t2 + F + M + E + C + pr + N + prd + prf + res + end + ens + der + end + web + end %% Legend in(input):::in diff --git a/lib/styles.css b/lib/styles.css new file mode 100644 index 0000000..1b3b416 --- /dev/null +++ b/lib/styles.css @@ -0,0 +1,4 @@ +:root { + /* https://quarto.org/docs/authoring/diagrams.html#customizing-mermaid */ + --mermaid-fg-color--lightest: #d3d3d3 +} diff --git a/renv.lock b/renv.lock index 959f39c..f2902f0 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.3.0", + "Version": "4.3.2", "Repositories": [ { "Name": "BioCsoft", @@ -138,29 +138,16 @@ ], "Hash": "c35768291560ce302c0a6589f92e837d" }, - "callr": { - "Package": "callr", - "Version": "3.7.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "R6", - "processx", - "utils" - ], - "Hash": "9b2191ede20fa29828139b9900922e51" - }, "cli": { "Package": "cli", - "Version": "3.6.1", + "Version": "3.6.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "utils" ], - "Hash": "89e6d8219950eac806ae0c489052048a" + "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" }, "clipr": { "Package": "clipr", @@ -188,10 +175,10 @@ }, "commonmark": { "Package": "commonmark", - "Version": "1.9.0", + "Version": "1.9.1", "Source": "Repository", "Repository": "RSPM", - "Hash": "d691c61bff84bd63c383874d2d0c3307" + "Hash": "5d8225445acb167abf7797de48b2ee3c" }, "cpp11": { "Package": "cpp11", @@ -217,24 +204,24 @@ }, "curl": { "Package": "curl", - "Version": "5.1.0", + "Version": "5.2.1", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R" ], - "Hash": "9123f3ef96a2c1a93927d828b2fe7d4c" + "Hash": "411ca2c03b1ce5f548345d2fc2685f7a" }, "digest": { "Package": "digest", - "Version": "0.6.33", + "Version": "0.6.35", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "utils" ], - "Hash": "b18a9cf3c003977b0cc49d5e76ebe48d" + "Hash": "698ece7ba5a4fa4559e3d537e7ec3d31" }, "ellipsis": { "Package": "ellipsis", @@ -260,7 +247,7 @@ }, "fansi": { "Package": "fansi", - "Version": "1.0.5", + "Version": "1.0.6", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -268,7 +255,7 @@ "grDevices", "utils" ], - "Hash": "3e8583a60163b4bc1a80016e63b9959e" + "Hash": "962174cf2aeb5b9eea581522286a911f" }, "farver": { "Package": "farver", @@ -329,14 +316,14 @@ }, "glue": { "Package": "glue", - "Version": "1.6.2", + "Version": "1.7.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "methods" ], - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" + "Hash": "e0b3a53876554bd45879e596cdb10a52" }, "here": { "Package": "here", @@ -427,13 +414,12 @@ }, "kableExtra": { "Package": "kableExtra", - "Version": "1.3.4", + "Version": "1.4.0", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "digest", - "glue", "grDevices", "graphics", "htmltools", @@ -441,17 +427,15 @@ "magrittr", "rmarkdown", "rstudioapi", - "rvest", "scales", "stats", "stringr", "svglite", "tools", "viridisLite", - "webshot", "xml2" ], - "Hash": "49b625e6aabe4c5f091f5850aba8ff78" + "Hash": "532d16304274c23c8563f94b79351c86" }, "knitr": { "Package": "knitr", @@ -609,19 +593,6 @@ ], "Hash": "6b01fc98b1e86c4f705ce9dcfd2f57c7" }, - "processx": { - "Package": "processx", - "Version": "3.8.2", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "R6", - "ps", - "utils" - ], - "Hash": "3efbd8ac1be0296a46c55387aeace0f3" - }, "progress": { "Package": "progress", "Version": "1.2.3", @@ -636,17 +607,6 @@ ], "Hash": "f4625e061cb2865f111b47ff163a5ca6" }, - "ps": { - "Package": "ps", - "Version": "1.7.5", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "utils" - ], - "Hash": "709d852d33178db54b17c722e5b1e594" - }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", @@ -659,7 +619,7 @@ }, "readr": { "Package": "readr", - "Version": "2.1.4", + "Version": "2.1.5", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -678,7 +638,7 @@ "utils", "vroom" ], - "Hash": "b5047343b3825f37ad9d3b5d89aa1078" + "Hash": "9de96463d2117f6ac49980577939dfb3" }, "remotes": { "Package": "remotes", @@ -696,30 +656,30 @@ }, "renv": { "Package": "renv", - "Version": "1.0.3", + "Version": "1.0.5", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "utils" ], - "Hash": "41b847654f567341725473431dd0d5ab" + "Hash": "32c3f93e8360f667ca5863272ec8ba6a" }, "rlang": { "Package": "rlang", - "Version": "1.1.2", + "Version": "1.1.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "utils" ], - "Hash": "50a6dbdc522936ca35afc5e2082ea91b" + "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.25", + "Version": "2.26", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "bslib", @@ -730,14 +690,13 @@ "jsonlite", "knitr", "methods", - "stringr", "tinytex", "tools", "utils", "xfun", "yaml" ], - "Hash": "d65e35823c817f09f4de424fcdfa812a" + "Hash": "9b148e7f95d33aac01f31282d49e4f44" }, "rprojroot": { "Package": "rprojroot", @@ -758,7 +717,7 @@ }, "rvest": { "Package": "rvest", - "Version": "1.0.3", + "Version": "1.0.4", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -771,10 +730,9 @@ "rlang", "selectr", "tibble", - "withr", "xml2" ], - "Hash": "a4a5ac819a467808c60e36e92ddf195e" + "Hash": "0bcf0c6f274e90ea314b812a6d19a519" }, "sass": { "Package": "sass", @@ -825,7 +783,7 @@ }, "stringi": { "Package": "stringi", - "Version": "1.8.2", + "Version": "1.8.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -834,7 +792,7 @@ "tools", "utils" ], - "Hash": "e68c45f81639001af5f1b15cd3599bbd" + "Hash": "058aebddea264f4c99401515182e656a" }, "stringr": { "Package": "stringr", @@ -855,7 +813,7 @@ }, "svglite": { "Package": "svglite", - "Version": "2.1.2", + "Version": "2.1.3", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -863,7 +821,7 @@ "cpp11", "systemfonts" ], - "Hash": "be5318f6b48c136ecd6b8b5de24cc0ae" + "Hash": "124a41fdfa23e8691cb744c762f10516" }, "sys": { "Package": "sys", @@ -874,14 +832,14 @@ }, "systemfonts": { "Package": "systemfonts", - "Version": "1.0.5", + "Version": "1.0.6", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "cpp11" ], - "Hash": "15b594369e70b975ba9f064295983499" + "Hash": "6d538cff441f0f1f36db2209ac7495ac" }, "tibble": { "Package": "tibble", @@ -904,7 +862,7 @@ }, "tidyselect": { "Package": "tidyselect", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -916,7 +874,7 @@ "vctrs", "withr" ], - "Hash": "79540e5fcd9e0435af547d885f184fd5" + "Hash": "829f27b9c4919c16b593794a6344d6c0" }, "tinytex": { "Package": "tinytex", @@ -999,42 +957,29 @@ ], "Hash": "390f9315bc0025be03012054103d227c" }, - "webshot": { - "Package": "webshot", - "Version": "0.5.5", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "callr", - "jsonlite", - "magrittr" - ], - "Hash": "16858ee1aba97f902d24049d4a44ef16" - }, "withr": { "Package": "withr", - "Version": "2.5.2", + "Version": "3.0.0", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "grDevices", - "graphics", - "stats" + "graphics" ], - "Hash": "4b25e70111b7d644322e9513f403a272" + "Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35" }, "xfun": { "Package": "xfun", - "Version": "0.41", + "Version": "0.42", "Source": "Repository", "Repository": "RSPM", "Requirements": [ + "grDevices", "stats", "tools" ], - "Hash": "460a5e0fe46a80ef87424ad216028014" + "Hash": "fd1349170df31f7a10bd98b0189e85af" }, "xml2": { "Package": "xml2", @@ -1051,10 +996,10 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.7", + "Version": "2.3.8", "Source": "Repository", - "Repository": "CRAN", - "Hash": "0d0056cc5383fbc240ccd0cb584bf436" + "Repository": "RSPM", + "Hash": "29240487a071f535f5e5d5a323b7afbd" } } } diff --git a/renv/activate.R b/renv/activate.R index cb5401f..9b2e7f1 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.3" + version <- "1.0.5" attr(version, "sha") <- NULL # the project directory @@ -31,6 +31,14 @@ local({ if (!is.null(override)) return(override) + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + # next, check environment variables # TODO: prefer using the configuration one in the future envvars <- c( @@ -50,9 +58,22 @@ local({ }) - if (!enabled) + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + return(FALSE) + } + # avoid recursion if (identical(getOption("renv.autoloader.running"), TRUE)) { warning("ignoring recursive attempt to run renv autoloader") @@ -1041,7 +1062,7 @@ local({ # if jsonlite is loaded, use that instead if ("jsonlite" %in% loadedNamespaces()) { - json <- catch(renv_json_read_jsonlite(file, text)) + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -1050,7 +1071,7 @@ local({ } # otherwise, fall back to the default JSON reader - json <- catch(renv_json_read_default(file, text)) + json <- tryCatch(renv_json_read_default(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -1063,14 +1084,14 @@ local({ } renv_json_read_jsonlite <- function(file = NULL, text = NULL) { - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") jsonlite::fromJSON(txt = text, simplifyVector = FALSE) } renv_json_read_default <- function(file = NULL, text = NULL) { # find strings in the JSON - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' locs <- gregexpr(pattern, text, perl = TRUE)[[1]] @@ -1118,14 +1139,14 @@ local({ map <- as.list(map) # remap strings in object - remapped <- renv_json_remap(json, map) + remapped <- renv_json_read_remap(json, map) # evaluate eval(remapped, envir = baseenv()) } - renv_json_remap <- function(json, map) { + renv_json_read_remap <- function(json, map) { # fix names if (!is.null(names(json))) { @@ -1152,7 +1173,7 @@ local({ # recurse if (is.recursive(json)) { for (i in seq_along(json)) { - json[i] <- list(renv_json_remap(json[[i]], map)) + json[i] <- list(renv_json_read_remap(json[[i]], map)) } }