From ba7dd0bdad38379c904b25071f25888b3f75378e Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Thu, 30 Nov 2023 10:00:38 -0500 Subject: [PATCH] Remove raster, rgdal, sp packages from dependencies (#187) * removes packages rgdal, raster, sp * replaced one line that was using raster * landscapemetrics changed to 2.0.0 * added macOS dependency, CI was failing * added to changelog --- .github/workflows/R-CMD-check.yaml | 2 +- CHANGELOG.md | 4 ++ DESCRIPTION | 3 -- NAMESPACE | 3 -- R/configuration.R | 2 - R/pops_multirun.R | 2 +- renv.lock | 84 ++---------------------------- tests/testthat.R | 1 - 8 files changed, 9 insertions(+), 92 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index e9f227e6..71f92e09 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -38,7 +38,7 @@ jobs: - name: Install macOS system dependencies if: runner.os == 'macOS' - run: brew install gdal proj + run: brew install gdal proj fribidi - uses: r-lib/actions/setup-renv@v2 - uses: r-lib/actions/setup-r-dependencies@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index fbf5fa8e..4da8e2a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,10 @@ this repository. - Fixed quarantine directions outputs in pops-multirun (@petrasovaa, #162). +### Removed + +- Removed dependencies: packages rgdal, raster, sp + ## [2.0.1] 2022-11-16 ### Added diff --git a/DESCRIPTION b/DESCRIPTION index 5ec95e1f..46041320 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,7 +31,6 @@ Imports: MASS, aws.s3, Metrics, - raster, methods License: GPL-3 | file LICENSE BugReports: https://github.com/ncsu-landscape-dynamics/rpops/issues @@ -42,8 +41,6 @@ SystemRequirements: GNU make Suggests: testthat, - rgdal, - sp, rlist, knitr, rmarkdown, diff --git a/NAMESPACE b/NAMESPACE index 9b722b0d..77da2b05 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -31,9 +31,6 @@ importFrom(methods,is) importFrom(parallel,detectCores) importFrom(parallel,makeCluster) importFrom(parallel,stopCluster) -importFrom(raster,calc) -importFrom(raster,cellStats) -importFrom(raster,extract) importFrom(stats,cov) importFrom(stats,median) importFrom(stats,rnorm) diff --git a/R/configuration.R b/R/configuration.R index 7763b316..81ddda0f 100644 --- a/R/configuration.R +++ b/R/configuration.R @@ -5,8 +5,6 @@ #' #' @param config list of all data necessary used to set up c++ model #' -#' @importFrom raster -#' cellStats calc extract #' @importFrom terra app rast xres yres classify extract ext as.points ncol nrow #' nlyr rowFromCell colFromCell values as.matrix rowFromCell colFromCell crs #' rowColFromCell global vect diff --git a/R/pops_multirun.R b/R/pops_multirun.R index 41fa2032..96c4cb66 100644 --- a/R/pops_multirun.R +++ b/R/pops_multirun.R @@ -573,7 +573,7 @@ pops_multirun <- function(infected_file, west_distance_to_quarantine <- data.frame(t(rep(NA, length(probability_runs[[1]])))) } - which_median <- function(x) raster::which.min(abs(x - median(x))) + which_median <- function(x) which.min(abs(x - median(x))) median_run_index <- which_median(infected_number[[ncol(infected_number)]]) min_run_index <- which.min(infected_number[[ncol(infected_number)]]) diff --git a/renv.lock b/renv.lock index 04081486..b6472fbf 100644 --- a/renv.lock +++ b/renv.lock @@ -569,26 +569,6 @@ ], "Hash": "7e5e3cbd2a7bc07880c94e22348fb661" }, - "igraph": { - "Package": "igraph", - "Version": "1.4.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "cpp11", - "grDevices", - "graphics", - "magrittr", - "methods", - "pkgconfig", - "rlang", - "stats", - "utils" - ], - "Hash": "f7f74f5fbff27d52b1283ac512bc5430" - }, "isoband": { "Package": "isoband", "Version": "0.2.7", @@ -660,7 +640,7 @@ }, "landscapemetrics": { "Package": "landscapemetrics", - "Version": "1.5.6", + "Version": "2.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -670,12 +650,11 @@ "cli", "ggplot2", "methods", - "raster", - "sp", "stats", + "terra", "tibble" ], - "Hash": "6c43fba1dd83b549ef471a36599898de" + "Hash": "101466a15b865990cd6e376df3f439de" }, "lattice": { "Package": "lattice", @@ -1005,20 +984,6 @@ ], "Hash": "5e3c5dc0b071b21fa128676560dbe94d" }, - "raster": { - "Package": "raster", - "Version": "3.6-20", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp", - "methods", - "sp", - "terra" - ], - "Hash": "ebebd9f0f203a129eb2da96470191b82" - }, "rcmdcheck": { "Package": "rcmdcheck", "Version": "1.4.0", @@ -1085,22 +1050,6 @@ ], "Hash": "ae34cd56890607370665bee5bd17812f" }, - "rgdal": { - "Package": "rgdal", - "Version": "1.6-7", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "methods", - "sp", - "stats", - "utils" - ], - "Hash": "10b777236c9e7855bc9dea8e347e30b7" - }, "rlang": { "Package": "rlang", "Version": "1.1.1", @@ -1205,23 +1154,6 @@ ], "Hash": "3f9796a8d0a0e8c6eb49a4b029359d1f" }, - "sp": { - "Package": "sp", - "Version": "1.6-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "grid", - "lattice", - "methods", - "stats", - "utils" - ], - "Hash": "ca27b2643e3593b7688244d035f2cd92" - }, "stringi": { "Package": "stringi", "Version": "1.7.12", @@ -1354,16 +1286,6 @@ ], "Hash": "8548b44f79a35ba1791308b61e6012d7" }, - "timechange": { - "Package": "timechange", - "Version": "0.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8548b44f79a35ba1791308b61e6012d7", - "Requirements": [ - "cpp11" - ] - }, "tinytex": { "Package": "tinytex", "Version": "0.45", diff --git a/tests/testthat.R b/tests/testthat.R index 4e824a6c..4d587943 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,5 +1,4 @@ library(testthat) -library(raster) library(PoPS) testthat::test_check("PoPS")