From 4fc773f7c8f36ef2f3034c5bcf87180d98c82524 Mon Sep 17 00:00:00 2001 From: Jason Flower Date: Thu, 12 Mar 2026 12:02:14 +1000 Subject: [PATCH 1/2] add mregion2 and rnaturalearth to imports; mregions2 now on CRAN --- DESCRIPTION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0a878a2..0c8397d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: spatialgridr Title: Grid spatial data -Version: 0.0.2.2 +Version: 0.0.2.3 Authors@R: person(given = "Jason", family = "Flower", email = "jflower@ucsb.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6731-8182")) Description: An R package that allows easy gridding of spatial data. License: GPL (>= 3) + file LICENSE @@ -13,16 +13,16 @@ Imports: dplyr, exactextractr, magrittr, + mregions2, remotes, rlang, + rnaturalearth, sf, stats, terra, utils Suggests: codetools, - mregions2 (>= 1.0.0), - rnaturalearth, rnaturalearthhires (>= 1.0.0.9000), testthat (>= 3.0.0) URL: https://emlab-ucsb.github.io/spatialgridr/ From 683129652f367dcf1ed8129f079f0ef1b2ca58b3 Mon Sep 17 00:00:00 2001 From: Jason Flower Date: Thu, 12 Mar 2026 12:08:58 +1000 Subject: [PATCH 2/2] add rnaturalearthhires as import, remove check for install code in get_boundary --- DESCRIPTION | 3 +-- R/get_boundary.R | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0c8397d..03911ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,16 +17,15 @@ Imports: remotes, rlang, rnaturalearth, + rnaturalearthhires (>= 1.0.0.9000), sf, stats, terra, utils Suggests: codetools, - rnaturalearthhires (>= 1.0.0.9000), testthat (>= 3.0.0) URL: https://emlab-ucsb.github.io/spatialgridr/ Config/testthat/edition: 3 Remotes: - github::lifewatch/mregions2, github::ropensci/rnaturalearthhires diff --git a/R/get_boundary.R b/R/get_boundary.R index c28a87b..f72f088 100644 --- a/R/get_boundary.R +++ b/R/get_boundary.R @@ -85,7 +85,6 @@ get_boundary <- function(name = "Australia", type = "eez", country_type = "count if(!(country_type %in% country_types) & !(type %in% c("ocean", "high_seas", "seas_oceans"))) stop(message = "'country_type' must be one of: ", paste(country_types, collapse = ", ")) if(type %in% mregions_types){ - rlang::check_installed("mregions2", reason = "to use `get_boundary()` to access marine boundaries", action = \(pkg, ...) remotes::install_github("lifewatch/mregions2")) query_type <- mregions_types_lookup[which(mregions_types == type)] if(type == "high_seas") return(mregions2::mrp_get("high_seas")) @@ -106,9 +105,6 @@ get_boundary <- function(name = "Australia", type = "eez", country_type = "count eval(parse(text = paste0("mregions2::mrp_get(\"", query_type, "\", cql_filter = \"", mregions_country_type, " = '", name, "'\")"))) } else{ - rlang::check_installed("rnaturalearth", reason = "to use `get_boundary()` to access land boundaries", action = \(pkg, ...) remotes::install_github("ropensci/rnaturalearth")) - rlang::check_installed("rnaturalearthhires", reason = "to use `get_boundary()` to access high resolution land boundaries", action = \(pkg, ...) remotes::install_github("ropensci/rnaturalearthhires")) - if(is.null(name)) { message("You have requested all ", type, " boundaries.") if(type == "country") return(rnaturalearth::ne_countries(scale = 10, returnclass = "sf")) else{