From 8f0c88f3aa5f532484ee3824658724dd6a11dfe7 Mon Sep 17 00:00:00 2001 From: Guido Maggio Date: Tue, 7 May 2024 13:52:23 +0200 Subject: [PATCH] Covid19Mirai 3.1.1 (#269) * Updated status badge * Updated renv and workflow * new version terra * Update system dependencies in WF * Sp importFrom * remove suggested packages not required --- .Rprofile | 1 + .github/workflows/ci-cd.yml | 32 +- DESCRIPTION | 8 +- NAMESPACE | 2 +- NEWS.md | 3 + R/mod_map.R | 1 + R/mod_map_calc_continent.R | 1 + R/mod_map_continent.R | 2 +- README.md | 6 +- renv.lock | 675 ++++++++++++++++-------------------- renv/activate.R | 147 +++++--- renv/settings.json | 2 +- 12 files changed, 420 insertions(+), 460 deletions(-) create mode 100644 .Rprofile diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 00000000..81b960f5 --- /dev/null +++ b/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 6da0048d..f16ec2e0 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -22,7 +22,7 @@ jobs: # single OS and R version, aligned with the target deployment environment matrix: config: - - {os: ubuntu-latest, r: '4.2.1'} + - {os: ubuntu-latest, r: 'renv'} env: # Access token for GitHub @@ -33,31 +33,33 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup R uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} # Enable RStudio Package Manager to speed up package installation - use-public-rspm: true - - # - name: Install system dependencies - # # This is not taken care of (yet) by r-lib/actions/setup-renv - # # Package distro used to get the distro for the used ubuntu-latest - # run: | - # Rscript -e "install.packages(c('remotes', 'distro'))" - # while read -r cmd - # do - # eval sudo $cmd + use-public-rspm: false + + - name: Install system dependencies + # This is not taken care of (yet) by r-lib/actions/setup-renv + # See https://github.com/r-lib/actions/issues/785 + run: | + # We rely on pkgdepends from the library embedded in pak + install.packages("pak", repos = "https://r-lib.github.io/p/pak/stable/") + install.packages("jsonlite") + .libPaths(c(system.file("library", package = "pak"), .libPaths())) + pkgdepends::new_pkg_installation_proposal( + names(jsonlite::read_json("renv.lock")$Packages), config = list(dependencies = FALSE) + )$solve()$install_sysreqs() + shell: Rscript {0} # done < <(Rscript -e 'writeLines(with(distro::distro(), remotes::system_requirements(id, short_version)))') - name: Activate renv and restore packages with cache uses: r-lib/actions/setup-renv@v2 - # - name: Install renv Development tools - # run: renv::install() - # shell: Rscript {0} + - name: Fetch and rebuild latest data if: false && github.event_name == 'schedule' # switched off diff --git a/DESCRIPTION b/DESCRIPTION index 63e683f9..a73f3e53 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Covid19Mirai Title: Covid-19 Data Analysis -Version: 3.1.0 +Version: 3.1.1 Authors@R: c(person("Riccardo", "Porreca", role = ("aut"), email = "riccardo.porreca@mirai-solutions.com"), @@ -42,11 +42,9 @@ Imports: zoo Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Suggests: rsconnect, spelling, pkgload, - testthat (>= 3.0.0), - sf, - packrat + testthat (>= 3.0.0) diff --git a/NAMESPACE b/NAMESPACE index 670359bf..3023ed04 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -73,7 +73,6 @@ import(lubridate) import(markdown) import(purrr) import(shiny) -import(sp) import(stringr) import(tidyr) import(zoo) @@ -119,4 +118,5 @@ importFrom(shiny,selectInput) importFrom(shiny,shinyApp) importFrom(shiny,tagList) importFrom(shinycssloaders,withSpinner) +importFrom(sp,merge) importFrom(stringr,str_to_title) diff --git a/NEWS.md b/NEWS.md index f7dc50cf..7077dc62 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +### Covid19Mirai 3.1.1 +* Updated status badge + ### Covid19Mirai 3.1.0 - Added action Buttons (#262) - Added data to RDS diff --git a/R/mod_map.R b/R/mod_map.R index f51ac757..747f98dd 100644 --- a/R/mod_map.R +++ b/R/mod_map.R @@ -72,6 +72,7 @@ mod_map_ui <- function(id){ #' @import tidyr #' @import leaflet #' @import leaflet.extras +#' @importFrom sp merge #' @noRd mod_map_server <- function(input, output, session, orig_data_aggregate, countries_data_map){ ns <- session$ns diff --git a/R/mod_map_calc_continent.R b/R/mod_map_calc_continent.R index 8add0d96..7388857d 100644 --- a/R/mod_map_calc_continent.R +++ b/R/mod_map_calc_continent.R @@ -37,6 +37,7 @@ mod_map_area_calc_ui <- function(id){ #' @import tidyr #' @import leaflet #' @import leaflet.extras +#' @importFrom sp merge #' #' @noRd mod_map_area_calc_server <- function(input, output, session, df, countries_data_map, area, variable = "confirmed", max.pop = 100000, countrymap = FALSE){ diff --git a/R/mod_map_continent.R b/R/mod_map_continent.R index d3cc58a5..6b84cde5 100644 --- a/R/mod_map_continent.R +++ b/R/mod_map_continent.R @@ -40,7 +40,7 @@ mod_map_cont_ui <- function(id){ #' @import dplyr #' @import tidyr #' @import leaflet -#' @import sp +#' @importFrom sp merge #' #' @noRd mod_map_cont_server <- function(input, output, session, orig_data_aggregate, countries_data_map, area, g_palette){ diff --git a/README.md b/README.md index 16ab0d73..28fdadd2 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ -[![R build -status](https://github.com/miraisolutions/Covid19/workflows/CI-CD/badge.svg)](https://github.com/miraisolutions/Covid19/actions) +[![ci-cd](https://github.com/miraisolutions/Covid19/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/miraisolutions/Covid19/actions/workflows/ci-cd.yml) [![eRum2020::CovidR](https://badgen.net/https/runkit.io/erum2020-covidr/badge/branches/master/vitalini-covid19?cache=300)](https://milano-r.github.io/erum2020-covidr-contest/vitalini-covid19.html) + The goal of Covid19Mirai is to provide an insight on corona virus data @@ -39,7 +39,7 @@ Ardia](https://ardiad.github.io/). We are very thankful to [David Bumbeishvili](https://github.com/bumbeishvili) for his great [work](https://github.com/bumbeishvili/covid19-daily-data) -**Update October 2023**, the app stops updating data and is frozen to `2022-09-01`. +**Update October 2023**, the app stops updating data and is frozen to `2022-06-01`. ## Data Storage diff --git a/renv.lock b/renv.lock index 407af8dc..e8977a60 100644 --- a/renv.lock +++ b/renv.lock @@ -1,46 +1,47 @@ { "R": { - "Version": "4.2.1", + "Version": "4.3.2", "Repositories": [ { "Name": "CRAN", - "URL": "https://cloud.r-project.org" + "URL": "https://packagemanager.posit.co/cran/latest" } ] }, "Packages": { "COVID19": { "Package": "COVID19", - "Version": "3.0.2", + "Version": "3.0.3", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R.utils", "data.table", "tools", "utils" ], - "Hash": "2820894519437a25b4103b62462fa334" + "Hash": "2365c33bee00c8d3da7d0619e292020e" }, "DT": { "Package": "DT", - "Version": "0.26", + "Version": "0.33", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "crosstalk", "htmltools", "htmlwidgets", + "httpuv", "jquerylib", "jsonlite", "magrittr", "promises" ], - "Hash": "c66a72c4d3499e14ae179ccb742e740a" + "Hash": "64ff3427f559ce3f2597a4fe13255cb6" }, "MASS": { "Package": "MASS", - "Version": "7.3-58.2", + "Version": "7.3-60", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -51,15 +52,16 @@ "stats", "utils" ], - "Hash": "e02d1a0f6122fd3e634b25b433704344" + "Hash": "a56a6365b3fa73293ea8d084be0d9bb0" }, "Matrix": { "Package": "Matrix", - "Version": "1.5-3", + "Version": "1.6-0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", + "grDevices", "graphics", "grid", "lattice", @@ -67,13 +69,24 @@ "stats", "utils" ], - "Hash": "4006dffe49958d2dd591c17e61e60591" + "Hash": "31262fd18481fab05c5e7258dac163ca" + }, + "PKI": { + "Package": "PKI", + "Version": "0.1-12", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc" + ], + "Hash": "999d7960fe5a5fd98267d0b68fd10065" }, "R.methodsS3": { "Package": "R.methodsS3", "Version": "1.8.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "utils" @@ -84,7 +97,7 @@ "Package": "R.oo", "Version": "1.25.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R.methodsS3", @@ -95,9 +108,9 @@ }, "R.utils": { "Package": "R.utils", - "Version": "2.12.1", + "Version": "2.12.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R.methodsS3", @@ -106,7 +119,7 @@ "tools", "utils" ], - "Hash": "1ed133420fcd2b93cf55a383b38fe27c" + "Hash": "325f01db13da12c04d8f6e7be36ff514" }, "R6": { "Package": "R6", @@ -130,24 +143,24 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.9", + "Version": "1.0.12", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods", "utils" ], - "Hash": "e9c08b94391e9f3f97355841229124f2" + "Hash": "5ea2700d21e038ace58269ecdbeb9ec0" }, "askpass": { "Package": "askpass", - "Version": "1.1", + "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "sys" ], - "Hash": "e8a22846fff485f0be3770c2da758713" + "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" }, "attempt": { "Package": "attempt", @@ -169,13 +182,6 @@ ], "Hash": "543776ae6848fde2f48ff3816d0628bc" }, - "brew": { - "Package": "brew", - "Version": "1.0-8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d69a786e85775b126bddbee185ae6084" - }, "brio": { "Package": "brio", "Version": "1.1.3", @@ -185,25 +191,27 @@ }, "bslib": { "Package": "bslib", - "Version": "0.4.0", + "Version": "0.5.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", + "base64enc", "cachem", "grDevices", "htmltools", "jquerylib", "jsonlite", "memoise", + "mime", "rlang", "sass" ], - "Hash": "be5ee090716ce1671be6cd5d7c34d091" + "Hash": "283015ddfbb9d7bf15ea9f0b5698f0d9" }, "bsplus": { "Package": "bsplus", - "Version": "0.1.3", + "Version": "0.1.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -218,18 +226,18 @@ "rmarkdown", "stringr" ], - "Hash": "76d14fb160c333fae3ee83350e2a915b" + "Hash": "2b1c662ff3624ddb37fcb07c6449e55b" }, "cachem": { "Package": "cachem", - "Version": "1.0.6", + "Version": "1.0.8", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "fastmap", "rlang" ], - "Hash": "648c5b3d71e6a37e3043617489a0a0e9" + "Hash": "c35768291560ce302c0a6589f92e837d" }, "callr": { "Package": "callr", @@ -246,28 +254,18 @@ }, "cli": { "Package": "cli", - "Version": "3.4.1", + "Version": "3.6.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "0d297d01734d2bcea40197bd4971a764" - }, - "clipr": { - "Package": "clipr", - "Version": "0.8.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "utils" - ], - "Hash": "3f038e5ac7f41d4ac41ce658c85e3042" + "Hash": "89e6d8219950eac806ae0c489052048a" }, "colorspace": { "Package": "colorspace", - "Version": "2.0-3", + "Version": "2.1-0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -277,31 +275,31 @@ "methods", "stats" ], - "Hash": "bb4341986bc8b914f0f0acf2e4a3f2f7" + "Hash": "f20c47fd52fae58b4e377c37bb8c335b" }, "commonmark": { "Package": "commonmark", - "Version": "1.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6e3e947d1d7ebf3d2bdcea1bde63fe7" + "Hash": "d691c61bff84bd63c383874d2d0c3307" }, "config": { "Package": "config", - "Version": "0.3.1", + "Version": "0.3.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "yaml" ], - "Hash": "31d77b09f63550cee9ecb5a08bf76e8f" + "Hash": "8b7222e9d9eb5178eea545c0c4d33fc2" }, "cpp11": { "Package": "cpp11", - "Version": "0.4.3", + "Version": "0.4.5", "Source": "Repository", - "Repository": "CRAN", - "Hash": "ed588261931ee3be2c700d22e94a29ab" + "Repository": "RSPM", + "Hash": "f07821e9b0aada6c999d4692e22a2ea7" }, "crayon": { "Package": "crayon", @@ -315,20 +313,6 @@ ], "Hash": "e8a1e41acf02548751f45c718d55aa6a" }, - "credentials": { - "Package": "credentials", - "Version": "1.3.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "askpass", - "curl", - "jsonlite", - "openssl", - "sys" - ], - "Hash": "93762d0a34d78e6a025efdbfb5c6bb41" - }, "crosstalk": { "Package": "crosstalk", "Version": "1.2.0", @@ -344,24 +328,24 @@ }, "curl": { "Package": "curl", - "Version": "4.3.3", + "Version": "5.0.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R" ], - "Hash": "0eb86baa62f06e8855258fa5a8048667" + "Hash": "511bacbfa153a15251166b463b4da4f9" }, "data.table": { "Package": "data.table", - "Version": "1.14.4", + "Version": "1.14.8", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "b9b912b41064aaa79270f24d123c887d" + "Hash": "b4c06e554f33344e044ccd7fdca750a9" }, "desc": { "Package": "desc", @@ -394,23 +378,24 @@ }, "digest": { "Package": "digest", - "Version": "0.6.30", + "Version": "0.6.33", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "bf1cd206a5d170d132ef75c7537b9bdb" + "Hash": "b18a9cf3c003977b0cc49d5e76ebe48d" }, "dplyr": { "Package": "dplyr", - "Version": "1.0.10", + "Version": "1.1.4", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R6", + "cli", "generics", "glue", "lifecycle", @@ -423,7 +408,7 @@ "utils", "vctrs" ], - "Hash": "539412282059f7f0c07295723d23f987" + "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" }, "ellipsis": { "Package": "ellipsis", @@ -438,18 +423,18 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.17", + "Version": "0.21", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "9171b012a55a1ef53f1442b1d798a3b4" + "Hash": "d59f3b464e8da1aef82dc04b588b8dfb" }, "fansi": { "Package": "fansi", - "Version": "1.0.3", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -457,7 +442,7 @@ "grDevices", "utils" ], - "Hash": "83a8afdbe71839506baa9f90eebad7ec" + "Hash": "1d9e7ad3c8312a192dea7d3db0274fde" }, "farver": { "Package": "farver", @@ -468,33 +453,33 @@ }, "fastmap": { "Package": "fastmap", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8" + "Hash": "f7736a18de97dea803bde0a2daaafb27" }, "fontawesome": { "Package": "fontawesome", - "Version": "0.4.0", + "Version": "0.5.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "htmltools", "rlang" ], - "Hash": "c5a628c2570aa86a96cc6ef739d8bfda" + "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" }, "fs": { "Package": "fs", - "Version": "1.5.2", + "Version": "1.6.3", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "methods" ], - "Hash": "7c89603d81793f0d5486d91ab1fc6f1d" + "Hash": "47b5f30c720c23999b913a1a635cf0bb" }, "generics": { "Package": "generics", @@ -507,68 +492,30 @@ ], "Hash": "15e9634c0fcd294799e9b2e929ed1b86" }, - "gert": { - "Package": "gert", - "Version": "1.9.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "askpass", - "credentials", - "openssl", - "rstudioapi", - "sys", - "zip" - ], - "Hash": "9a091a6d2fb91e43afd4337e2dcef2e7" - }, "ggplot2": { "Package": "ggplot2", - "Version": "3.3.6", + "Version": "3.5.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "MASS", "R", - "digest", + "cli", "glue", "grDevices", "grid", "gtable", "isoband", + "lifecycle", "mgcv", "rlang", "scales", "stats", "tibble", + "vctrs", "withr" ], - "Hash": "0fb26d0674c82705c6b701d1a61e02ea" - }, - "gh": { - "Package": "gh", - "Version": "1.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "gitcreds", - "httr", - "ini", - "jsonlite" - ], - "Hash": "b6a12054ee13dce0f6696c019c10e539" - }, - "gitcreds": { - "Package": "gitcreds", - "Version": "0.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "ab08ac61f3e1be454ae21911eb8bc2fe" + "Hash": "44c6a2f8202d5b7e878ea274b1092426" }, "glue": { "Package": "glue", @@ -583,53 +530,36 @@ }, "golem": { "Package": "golem", - "Version": "0.3.5", + "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "attempt", - "cli", "config", - "crayon", - "desc", - "fs", "here", "htmltools", - "pkgload", - "roxygen2", - "rstudioapi", + "rlang", "shiny", - "usethis", "utils", "yaml" ], - "Hash": "c4fbd853653f38cccdd009d75abb344c" - }, - "gridExtra": { - "Package": "gridExtra", - "Version": "2.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "graphics", - "grid", - "gtable", - "utils" - ], - "Hash": "7d7f283939f563670a697165b2cf5560" + "Hash": "dc12172dc35c6c80e18b430dc546fc24" }, "gtable": { "Package": "gtable", - "Version": "0.3.1", + "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", - "grid" + "cli", + "glue", + "grid", + "lifecycle", + "rlang" ], - "Hash": "36b4265fb818f6a342bed217549cd896" + "Hash": "b44addadb528a0d227794121c00572a0" }, "here": { "Package": "here", @@ -643,47 +573,50 @@ }, "highr": { "Package": "highr", - "Version": "0.9", + "Version": "0.10", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "xfun" ], - "Hash": "8eb36c8125038e648e5d111c0d7b2ed4" + "Hash": "06230136b2d2b9ba5805e1963fa6e890" }, "htmltools": { "Package": "htmltools", - "Version": "0.5.3", + "Version": "0.5.6", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "base64enc", "digest", + "ellipsis", "fastmap", "grDevices", "rlang", "utils" ], - "Hash": "6496090a9e00f8354b811d1a2d47b566" + "Hash": "a2326a66919a3311f7fbb1e3bf568283" }, "htmlwidgets": { "Package": "htmlwidgets", - "Version": "1.5.4", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "grDevices", "htmltools", "jsonlite", + "knitr", + "rmarkdown", "yaml" ], - "Hash": "76147821cd3fcd8c4b04e1ef0498e7fb" + "Hash": "a865aa85bcb2697f47505bfd70422471" }, "httpuv": { "Package": "httpuv", - "Version": "1.6.6", + "Version": "1.6.11", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -694,11 +627,11 @@ "promises", "utils" ], - "Hash": "fd090e236ae2dc0f0cdf33a9ec83afb6" + "Hash": "838602f54e32c1a0f8cc80708cefcefa" }, "httr": { "Package": "httr", - "Version": "1.4.4", + "Version": "1.4.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -709,25 +642,30 @@ "mime", "openssl" ], - "Hash": "57557fac46471f0dbbf44705cc6a5c8c" + "Hash": "7e5e3cbd2a7bc07880c94e22348fb661" }, - "ini": { - "Package": "ini", - "Version": "0.3.1", + "hunspell": { + "Package": "hunspell", + "Version": "3.0.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "6154ec2223172bce8162d4153cda21f7" + "Requirements": [ + "R", + "Rcpp", + "digest" + ], + "Hash": "656219b6f3f605499d7cdbe208656639" }, "isoband": { "Package": "isoband", - "Version": "0.2.6", + "Version": "0.2.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "grid", "utils" ], - "Hash": "cfdea9dea85c1a973991c8cbe299f4da" + "Hash": "0080607b4a1a7b28979aecef976d8bc2" }, "jquerylib": { "Package": "jquerylib", @@ -741,17 +679,17 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.3", + "Version": "1.8.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "8b1bd0be62956f2a6b91ce84fac79a45" + "Hash": "266a20443ca13c65688b2116d5220f76" }, "knitr": { "Package": "knitr", - "Version": "1.40", + "Version": "1.43", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -759,12 +697,11 @@ "evaluate", "highr", "methods", - "stringr", "tools", "xfun", "yaml" ], - "Hash": "caea8b0f899a0b1738444b9bc47067e7" + "Hash": "9775eb076713f627c07ce41d8199d8f6" }, "labeling": { "Package": "labeling", @@ -779,18 +716,18 @@ }, "later": { "Package": "later", - "Version": "1.3.0", + "Version": "1.3.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "Rcpp", "rlang" ], - "Hash": "7e7b457d7766bc47f2a5f21cc2984f8e" + "Hash": "40401c9cf2bc2259dfe83311c9384710" }, "lattice": { "Package": "lattice", - "Version": "0.20-45", + "Version": "0.21-8", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -801,7 +738,7 @@ "stats", "utils" ], - "Hash": "b64cdbb2b340437c4ee047a1f4c4377b" + "Hash": "0b8a6d63c8770f02a8b5635f3c431e6b" }, "lazyeval": { "Package": "lazyeval", @@ -815,34 +752,34 @@ }, "leaflet": { "Package": "leaflet", - "Version": "2.1.1", + "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "RColorBrewer", - "base64enc", "crosstalk", "htmltools", "htmlwidgets", + "jquerylib", "leaflet.providers", "magrittr", - "markdown", "methods", "png", "raster", "scales", "sp", "stats", - "viridis" + "viridisLite", + "xfun" ], - "Hash": "97fadb60ef6eb8524b9f6e2c4a69ee93" + "Hash": "ca012d4a706e21ce217ba15f22d402b2" }, "leaflet.extras": { "Package": "leaflet.extras", "Version": "1.0.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "htmltools", @@ -855,13 +792,14 @@ }, "leaflet.providers": { "Package": "leaflet.providers", - "Version": "1.9.0", + "Version": "2.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R" + "R", + "htmltools" ], - "Hash": "d3082a7beac4a1aeb96100ff06265d7e" + "Hash": "c0b81ad9d5d932772f7a457ac398cf36" }, "lifecycle": { "Package": "lifecycle", @@ -878,16 +816,16 @@ }, "lubridate": { "Package": "lubridate", - "Version": "1.8.0", + "Version": "1.9.3", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", - "cpp11", "generics", - "methods" + "methods", + "timechange" ], - "Hash": "2ff5eedb6ee38fb1b81205c73be1be5a" + "Hash": "680ad542fbcf801442c83a6ac5a2126c" }, "magrittr": { "Package": "magrittr", @@ -901,17 +839,16 @@ }, "markdown": { "Package": "markdown", - "Version": "1.3", + "Version": "1.12", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "commonmark", - "mime", "utils", "xfun" ], - "Hash": "b620b105af55519c26ca969a8da0930c" + "Hash": "765cf53992401b3b6c297b69e1edb8bd" }, "memoise": { "Package": "memoise", @@ -926,7 +863,7 @@ }, "mgcv": { "Package": "mgcv", - "Version": "1.8-41", + "Version": "1.9-0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -939,7 +876,7 @@ "stats", "utils" ], - "Hash": "6b3904f13346742caa3e82dd0303d4ad" + "Hash": "086028ca0460d0c368028d3bda58f31b" }, "mime": { "Package": "mime", @@ -978,29 +915,29 @@ }, "openssl": { "Package": "openssl", - "Version": "2.0.4", + "Version": "2.1.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "askpass" ], - "Hash": "e86c5ffeb8474a9e03d75f5d2919683e" + "Hash": "273a6bb4a9844c296a459d2176673270" }, "packrat": { "Package": "packrat", - "Version": "0.9.1", + "Version": "0.9.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "tools", "utils" ], - "Hash": "481428983c19a7c443f7ea1beff0a2de" + "Hash": "55ddd2d4a1959535f18393478b0c14a6" }, "pillar": { "Package": "pillar", - "Version": "1.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1013,7 +950,25 @@ "utils", "vctrs" ], - "Hash": "f2316df30902c81729ae9de95ad5a608" + "Hash": "15da5a8412f317beeee6175fbc76f4bb" + }, + "pkgbuild": { + "Package": "pkgbuild", + "Version": "1.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "callr", + "cli", + "crayon", + "desc", + "prettyunits", + "processx", + "rprojroot" + ], + "Hash": "beb25b32a957a22a5c301a9e441190b3" }, "pkgconfig": { "Package": "pkgconfig", @@ -1027,9 +982,9 @@ }, "pkgload": { "Package": "pkgload", - "Version": "1.3.1", + "Version": "1.3.4", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "cli", @@ -1038,18 +993,19 @@ "fs", "glue", "methods", + "pkgbuild", "rlang", "rprojroot", "utils", "withr" ], - "Hash": "3c0918b1792c75de2e640d1d8d12dead" + "Hash": "876c618df5ae610be84356d5d7a5d124" }, "plotly": { "Package": "plotly", - "Version": "4.10.0", + "Version": "4.10.4", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "RColorBrewer", @@ -1075,17 +1031,17 @@ "vctrs", "viridisLite" ], - "Hash": "fbb11e44d057996ca5fe40d959cacfb0" + "Hash": "a1ac5c03ad5ad12b9d1597e00e23c3dd" }, "png": { "Package": "png", - "Version": "0.1-7", + "Version": "0.1-8", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R" ], - "Hash": "03b7076c234cb3331288919983326c55" + "Hash": "bd54ba8a0a5faded999a7aab6e46b374" }, "praise": { "Package": "praise", @@ -1094,11 +1050,21 @@ "Repository": "CRAN", "Hash": "a555924add98c99d2f411e37e7d25e9f" }, + "prettyunits": { + "Package": "prettyunits", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "6b01fc98b1e86c4f705ce9dcfd2f57c7" + }, "processx": { "Package": "processx", "Version": "3.8.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R6", @@ -1109,18 +1075,19 @@ }, "promises": { "Package": "promises", - "Version": "1.2.0.1", + "Version": "1.2.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R6", "Rcpp", + "fastmap", "later", "magrittr", "rlang", "stats" ], - "Hash": "4ab2c43adb4d4699cf3690acd378d75d" + "Hash": "0d8a15c9d000970ada1ab21405387dee" }, "ps": { "Package": "ps", @@ -1135,15 +1102,18 @@ }, "purrr": { "Package": "purrr", - "Version": "0.3.5", + "Version": "1.0.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", + "cli", + "lifecycle", "magrittr", - "rlang" + "rlang", + "vctrs" ], - "Hash": "54842a2443c76267152eface28d9e90a" + "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc" }, "rappdirs": { "Package": "rappdirs", @@ -1157,9 +1127,9 @@ }, "raster": { "Package": "raster", - "Version": "3.6-3", + "Version": "3.6-23", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "Rcpp", @@ -1167,7 +1137,7 @@ "sp", "terra" ], - "Hash": "d550f9d6dbb4dce7cbd146b09d663343" + "Hash": "337d6d70f7d6bf78df236a5a53f09db0" }, "rematch2": { "Package": "rematch2", @@ -1181,34 +1151,35 @@ }, "renv": { "Package": "renv", - "Version": "1.0.0", + "Version": "1.0.7", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "c321cd99d56443dbffd1c9e673c0c1a2" + "Hash": "397b7b2a265bc5a7a06852524dabae20" }, "rlang": { "Package": "rlang", - "Version": "1.1.1", + "Version": "1.1.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb" + "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.17", + "Version": "2.24", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "bslib", "evaluate", + "fontawesome", "htmltools", "jquerylib", "jsonlite", @@ -1221,34 +1192,7 @@ "xfun", "yaml" ], - "Hash": "e97c8be593e010f93520e8215c0f9189" - }, - "roxygen2": { - "Package": "roxygen2", - "Version": "7.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "brew", - "cli", - "commonmark", - "cpp11", - "desc", - "digest", - "knitr", - "methods", - "pkgload", - "purrr", - "rlang", - "stringi", - "stringr", - "utils", - "withr", - "xml2" - ], - "Hash": "da1f278262e563c835345872f2fef537" + "Hash": "3854c37590717c08c32ec8542a2e0a35" }, "rprojroot": { "Package": "rprojroot", @@ -1262,10 +1206,11 @@ }, "rsconnect": { "Package": "rsconnect", - "Version": "1.0.2", + "Version": "1.2.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "PKI", "R", "cli", "curl", @@ -1280,20 +1225,20 @@ "tools", "yaml" ], - "Hash": "1f82a3e9e7e52f095b0f57869d957246" + "Hash": "77e9ed1307e84cd7ca1c7fb2cd7bbfe2" }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.14", + "Version": "0.15.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "690bd2acc42a9166ce34845884459320" + "Hash": "5564500e25cffad9e22244ced1379887" }, "sass": { "Package": "sass", - "Version": "0.4.2", + "Version": "0.4.7", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R6", "fs", @@ -1301,29 +1246,31 @@ "rappdirs", "rlang" ], - "Hash": "1b191143d7d3444d504277843f3a95fe" + "Hash": "6bd4d33b50ff927191ec9acbf52fd056" }, "scales": { "Package": "scales", - "Version": "1.2.1", + "Version": "1.3.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R6", "RColorBrewer", + "cli", "farver", + "glue", "labeling", "lifecycle", "munsell", "rlang", "viridisLite" ], - "Hash": "906cb23d2f1c5680b8ce439b44c6fa63" + "Hash": "c19df082ba346b0ffa6f833e92de34d1" }, "shiny": { "Package": "shiny", - "Version": "1.7.3", + "Version": "1.8.1.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1333,7 +1280,6 @@ "cachem", "commonmark", "crayon", - "ellipsis", "fastmap", "fontawesome", "glue", @@ -1353,13 +1299,13 @@ "withr", "xtable" ], - "Hash": "fe12df67fdb3b1142325cc54f100cc06" + "Hash": "54b26646816af9960a4c64d8ceec75d6" }, "shinycssloaders": { "Package": "shinycssloaders", "Version": "1.0.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "digest", @@ -1371,17 +1317,17 @@ }, "sourcetools": { "Package": "sourcetools", - "Version": "0.1.7", + "Version": "0.1.7-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "947e4e02a79effa5d512473e10f41797" + "Hash": "5f5a7629f956619d519205ec475fe647" }, "sp": { "Package": "sp", - "Version": "1.5-0", + "Version": "2.1-4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1394,11 +1340,24 @@ "stats", "utils" ], - "Hash": "2a118bdd2db0a301711e0a9e3e3206d5" + "Hash": "75940133cca2e339afce15a586f85b11" + }, + "spelling": { + "Package": "spelling", + "Version": "2.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "commonmark", + "hunspell", + "knitr", + "xml2" + ], + "Hash": "632e9e83d3dc774d361b9415b15642bb" }, "stringi": { "Package": "stringi", - "Version": "1.7.8", + "Version": "1.7.12", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1407,31 +1366,35 @@ "tools", "utils" ], - "Hash": "a68b980681bcbc84c7a67003fa796bfb" + "Hash": "ca8bd84263c77310739d2cf64d84d7c9" }, "stringr": { "Package": "stringr", - "Version": "1.4.1", + "Version": "1.5.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", + "cli", "glue", + "lifecycle", "magrittr", - "stringi" + "rlang", + "stringi", + "vctrs" ], - "Hash": "a66ad12140cd34d4f9dfcc19e84fc2a5" + "Hash": "960e2ae9e09656611e0b8214ad543207" }, "sys": { "Package": "sys", - "Version": "3.4.1", + "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "34c16f1ef796057bfa06d3f4ff818a5d" + "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" }, "terra": { "Package": "terra", - "Version": "1.6-17", + "Version": "1.7-76", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1439,11 +1402,11 @@ "Rcpp", "methods" ], - "Hash": "3e264754dde87261bc7ccdb30d29d3b4" + "Hash": "1384a200a959a6efb9cefb4a639d3771" }, "testthat": { "Package": "testthat", - "Version": "3.1.10", + "Version": "3.2.1.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1454,7 +1417,6 @@ "cli", "desc", "digest", - "ellipsis", "evaluate", "jsonlite", "lifecycle", @@ -1469,11 +1431,11 @@ "waldo", "withr" ], - "Hash": "6f403dc49295610a3a67ea1a9ca64346" + "Hash": "3f6e7e5e2220856ff865e4834766bf2b" }, "tibble": { "Package": "tibble", - "Version": "3.1.8", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1488,29 +1450,30 @@ "utils", "vctrs" ], - "Hash": "56b6934ef0f8c68225949a8672fe1a8f" + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" }, "tidyr": { "Package": "tidyr", - "Version": "1.2.1", + "Version": "1.3.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", + "cli", "cpp11", "dplyr", - "ellipsis", "glue", "lifecycle", "magrittr", "purrr", "rlang", + "stringr", "tibble", "tidyselect", "utils", "vctrs" ], - "Hash": "cdb403db0de33ccd1b6f53b83736efa8" + "Hash": "915fb7ce036c22a6a33b5a8adb712eb1" }, "tidyselect": { "Package": "tidyselect", @@ -1528,60 +1491,40 @@ ], "Hash": "79540e5fcd9e0435af547d885f184fd5" }, - "tinytex": { - "Package": "tinytex", - "Version": "0.42", + "timechange": { + "Package": "timechange", + "Version": "0.2.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "xfun" + "R", + "cpp11" ], - "Hash": "7629c6c1540835d5248e6e7df265fa74" + "Hash": "8548b44f79a35ba1791308b61e6012d7" }, - "usethis": { - "Package": "usethis", - "Version": "2.1.6", + "tinytex": { + "Package": "tinytex", + "Version": "0.45", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R", - "cli", - "clipr", - "crayon", - "curl", - "desc", - "fs", - "gert", - "gh", - "glue", - "jsonlite", - "lifecycle", - "purrr", - "rappdirs", - "rlang", - "rprojroot", - "rstudioapi", - "stats", - "utils", - "whisker", - "withr", - "yaml" + "xfun" ], - "Hash": "a67a22c201832b12c036cc059f1d137d" + "Hash": "e4e357f28c2edff493936b6cb30c3d65" }, "utf8": { "Package": "utf8", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "c9c462b759a5cc844ae25b5942654d13" + "Hash": "1fe17157424bb09c48a8b3b550c753bc" }, "vctrs": { "Package": "vctrs", - "Version": "0.5.0", + "Version": "0.6.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1591,31 +1534,17 @@ "lifecycle", "rlang" ], - "Hash": "001fd6a5ebfff8316baf9fb2b5516dc9" - }, - "viridis": { - "Package": "viridis", - "Version": "0.6.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "ggplot2", - "gridExtra", - "stats", - "viridisLite" - ], - "Hash": "ee96aee95a7a563e5496f8991e9fde4b" + "Hash": "c03fa420630029418f7e6da3667aac4a" }, "viridisLite": { "Package": "viridisLite", - "Version": "0.4.1", + "Version": "0.4.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "62f4b5da3e08d8e5bcba6cac15603f70" + "Hash": "c826c7c4241b6fc89ff55aaea3fa7491" }, "waldo": { "Package": "waldo", @@ -1634,13 +1563,6 @@ ], "Hash": "2c993415154cdb94649d99ae138ff5e5" }, - "whisker": { - "Package": "whisker", - "Version": "0.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ca970b96d894e90397ed20637a0c1bbe" - }, "withr": { "Package": "withr", "Version": "2.5.0", @@ -1656,25 +1578,25 @@ }, "xfun": { "Package": "xfun", - "Version": "0.34", + "Version": "0.40", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "stats", "tools" ], - "Hash": "9eba2411b0b1f879797141bd24df7407" + "Hash": "be07d23211245fc7d4209f54c4e4ffc8" }, "xml2": { "Package": "xml2", - "Version": "1.3.3", + "Version": "1.3.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "40682ed6a969ea5abfd351eb67833adc" + "Hash": "6c40e5cfcc6aefd88110666e18c31f40" }, "xtable": { "Package": "xtable", @@ -1690,21 +1612,14 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9b570515751dcbae610f29885e025b41" - }, - "zip": { - "Package": "zip", - "Version": "2.2.2", + "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "c42bfcec3fa6a0cce17ce1f8bc684f88" + "Hash": "0d0056cc5383fbc240ccd0cb584bf436" }, "zoo": { "Package": "zoo", - "Version": "1.8-11", + "Version": "1.8-12", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1715,7 +1630,7 @@ "stats", "utils" ], - "Hash": "874a5b77fe0cfacf2a3450069ae70926" + "Hash": "5c715954112b45499fb1dadc6ee6ee3e" } } } diff --git a/renv/activate.R b/renv/activate.R index cc742fc9..d13f9932 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,11 +2,28 @@ local({ # the requested version of renv - version <- "1.0.0" + version <- "1.0.7" attr(version, "sha") <- NULL # the project directory - project <- getwd() + project <- Sys.getenv("RENV_PROJECT") + if (!nzchar(project)) + project <- getwd() + + # use start-up diagnostics if enabled + diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") + if (diagnostics) { + start <- Sys.time() + profile <- tempfile("renv-startup-", fileext = ".Rprof") + utils::Rprof(profile) + on.exit({ + utils::Rprof(NULL) + elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) + writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) + writeLines(sprintf("- Profile: %s", profile)) + print(utils::summaryRprof(profile)) + }, add = TRUE) + } # figure out whether the autoloader is enabled enabled <- local({ @@ -16,6 +33,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( @@ -35,9 +60,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") @@ -93,6 +131,21 @@ local({ } + heredoc <- function(text, leave = 0) { + + # remove leading, trailing whitespace + trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) + + # split into lines + lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] + + # compute common indent + indent <- regexpr("[^[:space:]]", lines) + common <- min(setdiff(indent, -1L)) - leave + paste(substring(lines, common), collapse = "\n") + + } + startswith <- function(string, prefix) { substring(string, 1, nchar(prefix)) == prefix } @@ -504,7 +557,7 @@ local({ # open the bundle for reading # We use gzcon for everything because (from ?gzcon) - # > Reading from a connection which does not supply a ‘gzip’ magic + # > Reading from a connection which does not supply a 'gzip' magic # > header is equivalent to reading from the original connection conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) on.exit(close(conn)) @@ -595,6 +648,9 @@ local({ # if the user has requested an automatic prefix, generate it auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (is.na(auto) && getRversion() >= "4.4.0") + auto <- "TRUE" + if (auto %in% c("TRUE", "True", "true", "1")) return(renv_bootstrap_platform_prefix_auto()) @@ -767,10 +823,12 @@ local({ renv_bootstrap_validate_version <- function(version, description = NULL) { # resolve description file - description <- description %||% { - path <- getNamespaceInfo("renv", "path") - packageDescription("renv", lib.loc = dirname(path)) - } + # + # avoid passing lib.loc to `packageDescription()` below, since R will + # use the loaded version of the package by default anyhow. note that + # this function should only be called after 'renv' is loaded + # https://github.com/rstudio/renv/issues/1625 + description <- description %||% packageDescription("renv") # check whether requested version 'version' matches loaded version of renv sha <- attr(version, "sha", exact = TRUE) @@ -784,24 +842,23 @@ local({ # the loaded version of renv doesn't match the requested version; # give the user instructions on how to proceed - remote <- if (!is.null(description[["RemoteSha"]])) { + dev <- identical(description[["RemoteType"]], "github") + remote <- if (dev) paste("rstudio/renv", description[["RemoteSha"]], sep = "@") - } else { + else paste("renv", description[["Version"]], sep = "@") - } # display both loaded version + sha if available friendly <- renv_bootstrap_version_friendly( version = description[["Version"]], - sha = description[["RemoteSha"]] + sha = if (dev) description[["RemoteSha"]] ) - fmt <- paste( - "renv %1$s was loaded from project library, but this project is configured to use renv %2$s.", - "- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", - "- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", - sep = "\n" - ) + fmt <- heredoc(" + renv %1$s was loaded from project library, but this project is configured to use renv %2$s. + - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile. + - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library. + ") catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) FALSE @@ -841,7 +898,7 @@ local({ hooks <- getHook("renv::autoload") for (hook in hooks) if (is.function(hook)) - tryCatch(hook(), error = warning) + tryCatch(hook(), error = warnify) # load the project renv::load(project) @@ -982,10 +1039,15 @@ local({ } - renv_bootstrap_version_friendly <- function(version, sha = NULL) { + renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { sha <- sha %||% attr(version, "sha", exact = TRUE) - parts <- c(version, sprintf("[sha: %s]", substring(sha, 1L, 7L))) - paste(parts, collapse = " ") + parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) + paste(parts, collapse = "") + } + + renv_bootstrap_exec <- function(project, libpath, version) { + if (!renv_bootstrap_load(project, libpath, version)) + renv_bootstrap_run(version, libpath) } renv_bootstrap_run <- function(version, libpath) { @@ -1012,11 +1074,6 @@ local({ } - - renv_bootstrap_in_rstudio <- function() { - commandArgs()[[1]] == "RStudio" - } - renv_json_read <- function(file = NULL, text = NULL) { jlerr <- NULL @@ -1024,7 +1081,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) @@ -1033,7 +1090,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) @@ -1046,14 +1103,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]] @@ -1101,14 +1158,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))) { @@ -1135,7 +1192,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)) } } @@ -1155,26 +1212,8 @@ local({ # construct full libpath libpath <- file.path(root, prefix) - # attempt to load - if (renv_bootstrap_load(project, libpath, version)) - return(TRUE) - - if (renv_bootstrap_in_rstudio()) { - setHook("rstudio.sessionInit", function(...) { - renv_bootstrap_run(version, libpath) - - # Work around buglet in RStudio if hook uses readline - tryCatch( - { - tools <- as.environment("tools:rstudio") - tools$.rs.api.sendToConsole("", echo = FALSE, focus = FALSE) - }, - error = function(cnd) {} - ) - }) - } else { - renv_bootstrap_run(version, libpath) - } + # run bootstrap code + renv_bootstrap_exec(project, libpath, version) invisible() diff --git a/renv/settings.json b/renv/settings.json index ffdbb320..74c1d4bb 100644 --- a/renv/settings.json +++ b/renv/settings.json @@ -10,7 +10,7 @@ "ppm.enabled": null, "ppm.ignored.urls": [], "r.version": null, - "snapshot.type": "implicit", + "snapshot.type": "explicit", "use.cache": true, "vcs.ignore.cellar": true, "vcs.ignore.library": true,