From 25ba203a1c2d68bc6a07442996fad87da7813e67 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 11:52:09 -0400 Subject: [PATCH 01/11] removing dev environment cruft In order to get this to run locally in the current iteration of R, I had to upgrade some packages --- renv.lock | 75 ++++++++-- renv/.gitignore | 1 + renv/activate.R | 380 +++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 387 insertions(+), 69 deletions(-) diff --git a/renv.lock b/renv.lock index bd91525..b67c9ce 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.0.2", + "Version": "4.1.1", "Repositories": [ { "Name": "CRAN", @@ -128,6 +128,20 @@ "Repository": "CRAN", "Hash": "570a24963009b9cce0869a0463c83580" }, + "bslib": { + "Package": "bslib", + "Version": "0.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "56ae7e1987b340186a8a5a157c2ec358" + }, + "cachem": { + "Package": "cachem", + "Version": "1.0.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "648c5b3d71e6a37e3043617489a0a0e9" + }, "callr": { "Package": "callr", "Version": "3.5.1", @@ -291,10 +305,17 @@ }, "fastmap": { "Package": "fastmap", - "Version": "1.0.1", + "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "83ab58a0518afe3d17e41da01af13b60" + "Hash": "77bd60a6157420d4ffa93b27cf6a58b8" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "55624ed409e46c5f358b2c060be87f67" }, "forcats": { "Package": "forcats", @@ -303,6 +324,13 @@ "Repository": "CRAN", "Hash": "1cb4279e697650f0bd78cd3601ee7576" }, + "fs": { + "Package": "fs", + "Version": "1.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "44594a07a42e5f91fac9f93fda6d0109" + }, "generics": { "Package": "generics", "Version": "0.1.0", @@ -368,10 +396,10 @@ }, "htmltools": { "Package": "htmltools", - "Version": "0.5.0", + "Version": "0.5.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "7d651b7131794fe007b1ad6f21aaa401" + "Hash": "526c484233f42522278ab06fb185cb26" }, "htmlwidgets": { "Package": "htmlwidgets", @@ -408,6 +436,13 @@ "Repository": "CRAN", "Hash": "7eb42c3bb09e2019b97de69d2ea9dfff" }, + "jquerylib": { + "Package": "jquerylib", + "Version": "0.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5aab57a3bd297eee1c1d862735972182" + }, "jsonlite": { "Package": "jsonlite", "Version": "1.7.2", @@ -653,6 +688,13 @@ "Repository": "CRAN", "Hash": "97def703420c8ab10d8f0e6c72101e02" }, + "rappdirs": { + "Package": "rappdirs", + "Version": "0.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" + }, "raster": { "Package": "raster", "Version": "3.4-5", @@ -697,10 +739,10 @@ }, "renv": { "Package": "renv", - "Version": "0.12.3", + "Version": "0.14.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b5510c50c7f31d453c385c7b460af2b9" + "Hash": "30e5eba91b67f7f4d75d31de14bbfbdc" }, "rgdal": { "Package": "rgdal", @@ -718,10 +760,10 @@ }, "rlang": { "Package": "rlang", - "Version": "0.4.9", + "Version": "0.4.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "9d7aba7bed9a79e2403b4777428a2b12" + "Hash": "0879f5388fe6e4d56d7ef0b7ccb031e5" }, "rprojroot": { "Package": "rprojroot", @@ -737,6 +779,13 @@ "Repository": "CRAN", "Hash": "06c85365a03fdaf699966cc1d3cf53ea" }, + "sass": { + "Package": "sass", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "50cf822feb64bb3977bda0b7091be623" + }, "scales": { "Package": "scales", "Version": "1.1.1", @@ -746,10 +795,10 @@ }, "shiny": { "Package": "shiny", - "Version": "1.5.0", + "Version": "1.7.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "ee4ed72d7a5047d9e73cf922ad66e9c9" + "Hash": "00344c227c7bd0ab5d78052c5d736c44" }, "shinycssloaders": { "Package": "shinycssloaders", @@ -837,10 +886,10 @@ }, "tictoc": { "Package": "tictoc", - "Version": "1.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "f8cc5adf4671b013434bbe127f35b28c" + "Hash": "5acb66b0266ad1f0ebf7ffe1aa36ff4c" }, "tidyr": { "Package": "tidyr", diff --git a/renv/.gitignore b/renv/.gitignore index 574c256..993aebf 100644 --- a/renv/.gitignore +++ b/renv/.gitignore @@ -1,3 +1,4 @@ +local/ lock/ library/ python/ diff --git a/renv/activate.R b/renv/activate.R index 6841a96..304fd90 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,13 +2,27 @@ local({ # the requested version of renv - version <- "0.12.3" + version <- "0.14.0" # the project directory project <- getwd() + # allow environment variable to control activation + activate <- Sys.getenv("RENV_ACTIVATE_PROJECT") + if (!nzchar(activate)) { + + # don't auto-activate when R CMD INSTALL is running + if (nzchar(Sys.getenv("R_INSTALL_PKG"))) + return(FALSE) + + } + + # bail if activation was explicitly disabled + if (tolower(activate) %in% c("false", "f", "0")) + return(FALSE) + # avoid recursion - if (!is.na(Sys.getenv("RENV_R_INITIALIZING", unset = NA))) + if (nzchar(Sys.getenv("RENV_R_INITIALIZING"))) return(invisible(TRUE)) # signal that we're loading renv during R startup @@ -39,16 +53,6 @@ local({ # load bootstrap tools bootstrap <- function(version, library) { - # read repos (respecting override if set) - repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) - if (is.na(repos)) - repos <- getOption("repos") - - # fix up repos - on.exit(options(repos = repos), add = TRUE) - repos[repos == "@CRAN@"] <- "https://cloud.r-project.org" - options(repos = repos) - # attempt to download renv tarball <- tryCatch(renv_bootstrap_download(version), error = identity) if (inherits(tarball, "error")) @@ -61,25 +65,39 @@ local({ } - renv_bootstrap_download_impl <- function(url, destfile) { + renv_bootstrap_tests_running <- function() { + getOption("renv.tests.running", default = FALSE) + } - mode <- "wb" + renv_bootstrap_repos <- function() { - # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 - fixup <- - Sys.info()[["sysname"]] == "Windows" && - substring(url, 1L, 5L) == "file:" + # check for repos override + repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) + if (!is.na(repos)) + return(repos) - if (fixup) - mode <- "w+b" + # if we're testing, re-use the test repositories + if (renv_bootstrap_tests_running()) + return(getOption("renv.tests.repos")) - download.file( - url = url, - destfile = destfile, - mode = mode, - quiet = TRUE + # retrieve current repos + repos <- getOption("repos") + + # ensure @CRAN@ entries are resolved + repos[repos == "@CRAN@"] <- getOption( + "renv.repos.cran", + "https://cloud.r-project.org" ) + # add in renv.bootstrap.repos if set + default <- c(FALLBACK = "https://cloud.r-project.org") + extra <- getOption("renv.bootstrap.repos", default = default) + repos <- c(repos, extra) + + # remove duplicates that might've snuck in + dupes <- duplicated(repos) | duplicated(names(repos)) + repos[!dupes] + } renv_bootstrap_download <- function(version) { @@ -90,7 +108,9 @@ local({ components <- unclass(nv)[[1]] methods <- if (length(components) == 4L) { - list(renv_bootstrap_download_github) + list( + renv_bootstrap_download_github + ) } else { list( renv_bootstrap_download_cran_latest, @@ -108,14 +128,44 @@ local({ } + renv_bootstrap_download_impl <- function(url, destfile) { + + mode <- "wb" + + # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 + fixup <- + Sys.info()[["sysname"]] == "Windows" && + substring(url, 1L, 5L) == "file:" + + if (fixup) + mode <- "w+b" + + utils::download.file( + url = url, + destfile = destfile, + mode = mode, + quiet = TRUE + ) + + } + renv_bootstrap_download_cran_latest <- function(version) { - repos <- renv_bootstrap_download_cran_latest_find(version) + spec <- renv_bootstrap_download_cran_latest_find(version) - message("* Downloading renv ", version, " from CRAN ... ", appendLF = FALSE) + message("* Downloading renv ", version, " ... ", appendLF = FALSE) + + type <- spec$type + repos <- spec$repos info <- tryCatch( - download.packages("renv", repos = repos, destdir = tempdir(), quiet = TRUE), + utils::download.packages( + pkgs = "renv", + destdir = tempdir(), + repos = repos, + type = type, + quiet = TRUE + ), condition = identity ) @@ -124,37 +174,52 @@ local({ return(FALSE) } - message("OK") + # report success and return + message("OK (downloaded ", type, ")") info[1, 2] } renv_bootstrap_download_cran_latest_find <- function(version) { - # check for renv on CRAN matching this version - all <- unique(c( - getOption("repos"), - getOption("renv.bootstrap.repos", default = "https://cloud.r-project.org") - )) + # check whether binaries are supported on this system + binary <- + getOption("renv.bootstrap.binary", default = TRUE) && + !identical(.Platform$pkgType, "source") && + !identical(getOption("pkgType"), "source") && + Sys.info()[["sysname"]] %in% c("Darwin", "Windows") - for (repos in all) { + types <- c(if (binary) "binary", "source") - db <- tryCatch( - as.data.frame(available.packages(repos = repos), stringsAsFactors = FALSE), - error = identity - ) + # iterate over types + repositories + for (type in types) { + for (repos in renv_bootstrap_repos()) { - if (inherits(db, "error")) - next + # retrieve package database + db <- tryCatch( + as.data.frame( + utils::available.packages(type = type, repos = repos), + stringsAsFactors = FALSE + ), + error = identity + ) - entry <- db[db$Package %in% "renv" & db$Version %in% version, ] - if (nrow(entry) == 0) - next + if (inherits(db, "error")) + next - return(repos) + # check for compatible entry + entry <- db[db$Package %in% "renv" & db$Version %in% version, ] + if (nrow(entry) == 0) + next + + # found it; return spec to caller + spec <- list(entry = entry, type = type, repos = repos) + return(spec) + } } + # if we got here, we failed to find renv fmt <- "renv %s is not available from your declared package repositories" stop(sprintf(fmt, version)) @@ -163,11 +228,11 @@ local({ renv_bootstrap_download_cran_archive <- function(version) { name <- sprintf("renv_%s.tar.gz", version) - repos <- getOption("repos") + repos <- renv_bootstrap_repos() urls <- file.path(repos, "src/contrib/Archive/renv", name) destfile <- file.path(tempdir(), name) - message("* Downloading renv ", version, " from CRAN archive ... ", appendLF = FALSE) + message("* Downloading renv ", version, " ... ", appendLF = FALSE) for (url in urls) { @@ -226,7 +291,7 @@ local({ return(FALSE) } - message("Done!") + message("OK") return(destfile) } @@ -258,7 +323,7 @@ local({ } - renv_bootstrap_prefix <- function() { + renv_bootstrap_platform_prefix <- function() { # construct version prefix version <- paste(R.version$major, R.version$minor, sep = ".") @@ -277,8 +342,8 @@ local({ components <- c(prefix, R.version$platform) # include prefix if provided by user - prefix <- Sys.getenv("RENV_PATHS_PREFIX") - if (nzchar(prefix)) + prefix <- renv_bootstrap_platform_prefix_impl() + if (!is.na(prefix) && nzchar(prefix)) components <- c(prefix, components) # build prefix @@ -286,6 +351,152 @@ local({ } + renv_bootstrap_platform_prefix_impl <- function() { + + # if an explicit prefix has been supplied, use it + prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA) + if (!is.na(prefix)) + return(prefix) + + # if the user has requested an automatic prefix, generate it + auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (auto %in% c("TRUE", "True", "true", "1")) + return(renv_bootstrap_platform_prefix_auto()) + + # empty string on failure + "" + + } + + renv_bootstrap_platform_prefix_auto <- function() { + + prefix <- tryCatch(renv_bootstrap_platform_os(), error = identity) + if (inherits(prefix, "error") || prefix %in% "unknown") { + + msg <- paste( + "failed to infer current operating system", + "please file a bug report at https://github.com/rstudio/renv/issues", + sep = "; " + ) + + warning(msg) + + } + + prefix + + } + + renv_bootstrap_platform_os <- function() { + + sysinfo <- Sys.info() + sysname <- sysinfo[["sysname"]] + + # handle Windows + macOS up front + if (sysname == "Windows") + return("windows") + else if (sysname == "Darwin") + return("macos") + + # check for os-release files + for (file in c("/etc/os-release", "/usr/lib/os-release")) + if (file.exists(file)) + return(renv_bootstrap_platform_os_via_os_release(file, sysinfo)) + + # check for redhat-release files + if (file.exists("/etc/redhat-release")) + return(renv_bootstrap_platform_os_via_redhat_release()) + + "unknown" + + } + + renv_bootstrap_platform_os_via_os_release <- function(file, sysinfo) { + + # read /etc/os-release + release <- utils::read.table( + file = file, + sep = "=", + quote = c("\"", "'"), + col.names = c("Key", "Value"), + comment.char = "#", + stringsAsFactors = FALSE + ) + + vars <- as.list(release$Value) + names(vars) <- release$Key + + # get os name + os <- tolower(sysinfo[["sysname"]]) + + # read id + id <- "unknown" + for (field in c("ID", "ID_LIKE")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + id <- vars[[field]] + break + } + } + + # read version + version <- "unknown" + for (field in c("UBUNTU_CODENAME", "VERSION_CODENAME", "VERSION_ID", "BUILD_ID")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + version <- vars[[field]] + break + } + } + + # join together + paste(c(os, id, version), collapse = "-") + + } + + renv_bootstrap_platform_os_via_redhat_release <- function() { + + # read /etc/redhat-release + contents <- readLines("/etc/redhat-release", warn = FALSE) + + # infer id + id <- if (grepl("centos", contents, ignore.case = TRUE)) + "centos" + else if (grepl("redhat", contents, ignore.case = TRUE)) + "redhat" + else + "unknown" + + # try to find a version component (very hacky) + version <- "unknown" + + parts <- strsplit(contents, "[[:space:]]")[[1L]] + for (part in parts) { + + nv <- tryCatch(numeric_version(part), error = identity) + if (inherits(nv, "error")) + next + + version <- nv[1, 1] + break + + } + + paste(c("linux", id, version), collapse = "-") + + } + + renv_bootstrap_library_root_name <- function(project) { + + # use project name as-is if requested + asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE") + if (asis) + return(basename(project)) + + # otherwise, disambiguate based on project's path + id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) + paste(basename(project), id, sep = "-") + + } + renv_bootstrap_library_root <- function(project) { path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA) @@ -294,12 +505,12 @@ local({ path <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA) if (!is.na(path)) { - id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) - name <- paste(basename(project), id, sep = "-") + name <- renv_bootstrap_library_root_name(project) return(file.path(path, name)) } - file.path(project, "renv/library") + prefix <- renv_bootstrap_profile_prefix() + paste(c(project, prefix, "renv/library"), collapse = "/") } @@ -356,12 +567,69 @@ local({ TRUE } + + renv_bootstrap_profile_load <- function(project) { + + # if RENV_PROFILE is already set, just use that + profile <- Sys.getenv("RENV_PROFILE", unset = NA) + if (!is.na(profile) && nzchar(profile)) + return(profile) + + # check for a profile file (nothing to do if it doesn't exist) + path <- file.path(project, "renv/local/profile") + if (!file.exists(path)) + return(NULL) + + # read the profile, and set it if it exists + contents <- readLines(path, warn = FALSE) + if (length(contents) == 0L) + return(NULL) + + # set RENV_PROFILE + profile <- contents[[1L]] + if (nzchar(profile)) + Sys.setenv(RENV_PROFILE = profile) + + profile + + } + + renv_bootstrap_profile_prefix <- function() { + profile <- renv_bootstrap_profile_get() + if (!is.null(profile)) + return(file.path("renv/profiles", profile)) + } + + renv_bootstrap_profile_get <- function() { + profile <- Sys.getenv("RENV_PROFILE", unset = "") + renv_bootstrap_profile_normalize(profile) + } + + renv_bootstrap_profile_set <- function(profile) { + profile <- renv_bootstrap_profile_normalize(profile) + if (is.null(profile)) + Sys.unsetenv("RENV_PROFILE") + else + Sys.setenv(RENV_PROFILE = profile) + } + + renv_bootstrap_profile_normalize <- function(profile) { + + if (is.null(profile) || profile %in% c("", "default")) + return(NULL) + + profile + + } + + # load the renv profile, if any + renv_bootstrap_profile_load(project) # construct path to library root root <- renv_bootstrap_library_root(project) # construct library prefix for platform - prefix <- renv_bootstrap_prefix() + prefix <- renv_bootstrap_platform_prefix() # construct full libpath libpath <- file.path(root, prefix) From c8897c3acff3824f7771a26ded32cbeace241e00 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 11:55:55 -0400 Subject: [PATCH 02/11] fixing typo in census tbl message Fixing a typo'd reference to the COUNTIES spatial df --- server.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.R b/server.R index 318918a..89124f3 100644 --- a/server.R +++ b/server.R @@ -411,7 +411,7 @@ server <- function(session, input, output) { output$census_tbl_url <- renderUI({ if (input$mm_county_box != "All Counties of NJ") { - this_fips <- counties@data %>% + this_fips <- COUNTIES@data %>% filter(County_Name == input$mm_county_box) %>% pull(FIPSSTCO) From 79641319e9fd25b8e7c8be4f5af03a8ead0bb9cb Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 12:55:29 -0400 Subject: [PATCH 03/11] Updating version of R in workflow ymls --- .github/workflows/njmmbuild.workflow.yml | 2 +- .github/workflows/njmmdeploy.workflow.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/njmmbuild.workflow.yml b/.github/workflows/njmmbuild.workflow.yml index 05274e0..32b1ba7 100644 --- a/.github/workflows/njmmbuild.workflow.yml +++ b/.github/workflows/njmmbuild.workflow.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: [4.0] + r-version: [4.1] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/njmmdeploy.workflow.yml b/.github/workflows/njmmdeploy.workflow.yml index 0d29ec7..1d8be59 100644 --- a/.github/workflows/njmmdeploy.workflow.yml +++ b/.github/workflows/njmmdeploy.workflow.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: [4.0] + r-version: [4.1] steps: - uses: actions/checkout@v2 From 1cfa5b5807761f30c78bb83268704edf6769cd71 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 13:00:04 -0400 Subject: [PATCH 04/11] updating r-lib hash target for r v4.1 --- .github/workflows/njmmbuild.workflow.yml | 2 +- .github/workflows/njmmdeploy.workflow.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/njmmbuild.workflow.yml b/.github/workflows/njmmbuild.workflow.yml index 32b1ba7..0bca7d0 100644 --- a/.github/workflows/njmmbuild.workflow.yml +++ b/.github/workflows/njmmbuild.workflow.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up R ${{ matrix.r-version }} - uses: r-lib/actions/setup-r@b75d3e0c21718c20529373a7dd35ff5e1c1a5759 + uses: r-lib/actions/setup-r@0b468bae2ad53083dd2f475122202e8db2986d46 with: r-version: ${{ matrix.r-version }} Ncpus: 4 diff --git a/.github/workflows/njmmdeploy.workflow.yml b/.github/workflows/njmmdeploy.workflow.yml index 1d8be59..a6107ae 100644 --- a/.github/workflows/njmmdeploy.workflow.yml +++ b/.github/workflows/njmmdeploy.workflow.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up R ${{ matrix.r-version }} - uses: r-lib/actions/setup-r@b75d3e0c21718c20529373a7dd35ff5e1c1a5759 + uses: r-lib/actions/setup-r@0b468bae2ad53083dd2f475122202e8db2986d46 with: r-version: ${{ matrix.r-version }} Ncpus: 4 From 81b6e36c26a8c6e2289b71d76f2ca38eef8446a7 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 13:05:58 -0400 Subject: [PATCH 05/11] fixing quotes in R version in yml files --- .github/workflows/njmmbuild.workflow.yml | 2 +- .github/workflows/njmmdeploy.workflow.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/njmmbuild.workflow.yml b/.github/workflows/njmmbuild.workflow.yml index 0bca7d0..e601082 100644 --- a/.github/workflows/njmmbuild.workflow.yml +++ b/.github/workflows/njmmbuild.workflow.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: [4.1] + r-version: ['4.1'] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/njmmdeploy.workflow.yml b/.github/workflows/njmmdeploy.workflow.yml index a6107ae..554d67a 100644 --- a/.github/workflows/njmmdeploy.workflow.yml +++ b/.github/workflows/njmmdeploy.workflow.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: [4.1] + r-version: ['4.1'] steps: - uses: actions/checkout@v2 From 99c5f9c3fb5e8e0bc72cdc3e9d679faa79cfc85a Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 13:12:05 -0400 Subject: [PATCH 06/11] trying R v4.1.1 --- .github/workflows/njmmbuild.workflow.yml | 2 +- .github/workflows/njmmdeploy.workflow.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/njmmbuild.workflow.yml b/.github/workflows/njmmbuild.workflow.yml index e601082..3565499 100644 --- a/.github/workflows/njmmbuild.workflow.yml +++ b/.github/workflows/njmmbuild.workflow.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: ['4.1'] + r-version: ['4.1.1'] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/njmmdeploy.workflow.yml b/.github/workflows/njmmdeploy.workflow.yml index 554d67a..ee7833f 100644 --- a/.github/workflows/njmmdeploy.workflow.yml +++ b/.github/workflows/njmmdeploy.workflow.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: ['4.1'] + r-version: ['4.1.1'] steps: - uses: actions/checkout@v2 From b387226765aabd91d7457be9ae28d3494f60a235 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 14:11:14 -0400 Subject: [PATCH 07/11] Updating color palette tests to be more robust --- test/unit_tests/test_color_utils.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/unit_tests/test_color_utils.R b/test/unit_tests/test_color_utils.R index 5145935..59b1b53 100644 --- a/test/unit_tests/test_color_utils.R +++ b/test/unit_tests/test_color_utils.R @@ -5,10 +5,14 @@ source("./app_utils/color_utils.R") test_mmr_values <- readRDS("data/processed/mmr.rds") %>% pull(mmratio_per_100klb) +pal_to_test <- create_custom_pal(test_mmr_values, "mmratio_per_100klb") +pal_stored <- readRDS("test/test_data/color_utils_test/mmratio_custom_palette.RDS") + test_that( "Testing Defaut MMRatio Color Palette", + expect_equal( - create_custom_pal(test_mmr_values, "mmratio_per_100klb"), - readRDS("test/test_data/color_utils_test/mmratio_custom_palette.RDS") + pal_to_test(test_mmr_values), + pal_stored(test_mmr_values) ) ) From 0be7cf49dc879b22227adcaee7576df58d03acb2 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 14:18:35 -0400 Subject: [PATCH 08/11] quashing rcpp error via https://stackoverflow.com/questions/68416435/rcpp-package-doesnt-include-rcpp-precious-remove --- renv.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renv.lock b/renv.lock index b67c9ce..c275a4a 100644 --- a/renv.lock +++ b/renv.lock @@ -67,10 +67,10 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.5", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "125dc7a0ed375eb68c0ce533b48d291f" + "Hash": "dab19adae4440ae55aa8a9d238b246bb" }, "askpass": { "Package": "askpass", From 50f082fcbdbb10b36e71ccf68a0bdd3bc7d1a40f Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 14:28:29 -0400 Subject: [PATCH 09/11] Fixing polygon test There seems to be change in behavior due to the package updates here where the output is now silent so updating test accordingly --- test/unit_tests/test_leaflet_utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit_tests/test_leaflet_utils.R b/test/unit_tests/test_leaflet_utils.R index 26978b8..946c8b6 100644 --- a/test/unit_tests/test_leaflet_utils.R +++ b/test/unit_tests/test_leaflet_utils.R @@ -33,7 +33,7 @@ COUNTIES <- readRDS("data/processed/nj_counties_simplified.RDS") test_that( "Testing Other Layers", { - expect_message( + expect_silent( leaflet() %>% add_polygons_layer_map("Blues", "Percent Uninsured", 100, pct_uninsured) ) From e083eab7af1b0a87326cdf07c71caff299d00b2c Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 14:30:35 -0400 Subject: [PATCH 10/11] Fixing title test Again, updating the packages resulted in slightly different output (e.g. new html tags) with no functional changes so adjusting --- test/unit_tests/test_title_utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit_tests/test_title_utils.R b/test/unit_tests/test_title_utils.R index 6480889..174fb03 100644 --- a/test/unit_tests/test_title_utils.R +++ b/test/unit_tests/test_title_utils.R @@ -144,7 +144,7 @@ test_that( '2010 OB/GYN Physicians Per Capita by County' since no data is available for 2014", expect_equal( build_layer_map_title(2014, "OB/GYN Physicians Per Capita"), - '2010 OB/GYN Physicians Per Capita by County
Years differ due to data availability.' %>% HTML() + '2010 OB/GYN Physicians Per Capita by County
Years differ due to data availability.' %>% HTML() ) ) From fc29238dd271072205749e05aa92885d39510da4 Mon Sep 17 00:00:00 2001 From: Doug Friedman Date: Mon, 1 Nov 2021 15:29:16 -0400 Subject: [PATCH 11/11] Reverting leaflet test change --- test/unit_tests/test_leaflet_utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit_tests/test_leaflet_utils.R b/test/unit_tests/test_leaflet_utils.R index 946c8b6..26978b8 100644 --- a/test/unit_tests/test_leaflet_utils.R +++ b/test/unit_tests/test_leaflet_utils.R @@ -33,7 +33,7 @@ COUNTIES <- readRDS("data/processed/nj_counties_simplified.RDS") test_that( "Testing Other Layers", { - expect_silent( + expect_message( leaflet() %>% add_polygons_layer_map("Blues", "Percent Uninsured", 100, pct_uninsured) )