diff --git a/DESCRIPTION b/DESCRIPTION index 96df39b1..96e9c057 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,10 @@ Package: StormR Title: R package to compute the behaviour of wind generated by tropical storms and cyclones +Maintainer: Thomas Arsouze Version: 0.1.0 +URL: https://umr-amap.github.io/StormR/ +BugReports: https://github.com/umr-amap/StormR/issues/new/choose Authors@R: c( person("Baptiste", "Delaporte", , "baptiste.delaporte@protonmail.com", role = c("aut", "cre")), person("Thomas", "Ibanez", , "thomas.ibanez@ird.fr", role = "aut", @@ -27,7 +30,6 @@ Imports: methods, ncdf4, rworldmap, - rworldxtra, sf, sp, stringr, @@ -35,6 +37,7 @@ Imports: utils, zoo Suggests: + rworldxtra, knitr, rmarkdown, testthat (>= 3.0.0) diff --git a/NAMESPACE b/NAMESPACE index 5a0b001d..b4d00ffe 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -24,7 +24,6 @@ export(writeRast) exportClasses(storm) exportClasses(stormsDataset) exportClasses(stormsList) -import(rworldxtra) -import(sp) importFrom(methods,as) importFrom(methods,new) +importFrom(methods,show) diff --git a/R/getStorms.R b/R/getStorms.R index 2e69b25c..07a97ab5 100644 --- a/R/getStorms.R +++ b/R/getStorms.R @@ -74,7 +74,7 @@ setOldClass("sf") #' is EPSG:4326 #' @slot spatialLoiBuffer sf object. Buffer extension of `spatialLoi` #' @importFrom methods new -#' @import sp +#' @importFrom methods show #' @export stormsList <- methods::setClass("stormsList", slots = c(data = "list", diff --git a/R/plotStorms.R b/R/plotStorms.R index 439a1a99..354181cf 100644 --- a/R/plotStorms.R +++ b/R/plotStorms.R @@ -116,7 +116,7 @@ plotLabels <- function(st, by, pos) { #' @param ylim numeric vector #' @return NULL checkInputsPlotStorms <- function(sts, names, category, labels, by, - pos, legends, loi, xlim, ylim) { + pos, legends, loi, xlim, ylim) { # Checking sts input stopifnot("no data to plot" = !missing(sts)) @@ -207,7 +207,6 @@ checkInputsPlotStorms <- function(sts, names, category, labels, by, #' `"bottomleft"`, `"bottomright"`, or `"none"` (legend not plotted). #' @param loi logical. Whether (TRUE, default setting) or not (FALSE) to plot the #' extent of the buffered location of interest on the map. -#' @import rworldxtra #' #' @examples #' \dontrun{ diff --git a/tests/testthat/test-getStorms.R b/tests/testthat/test-getStorms.R index 3d7030d6..c2ca00bb 100644 --- a/tests/testthat/test-getStorms.R +++ b/tests/testthat/test-getStorms.R @@ -313,7 +313,7 @@ test_that("StormsList class getters", { test_that("Storm and stormsList class getters", { suppressWarnings(sds <- defDatabase(verbose = 0)) sts_nc <- defStormsList(sds = sds, loi = "New Caledonia", verbose = 0) - out <- capture_output_lines(show(sts_nc@data$PAM)) + out <- capture_output_lines(sp::show(sts_nc@data$PAM)) # Check that the Storm output is correct expect_match(out[1], "Name: PAM") @@ -323,7 +323,7 @@ test_that("Storm and stormsList class getters", { expect_match(out[7], "1 2015-03-08 12:00:00 168.9000 -7.500000 13 -1 93 100400 100500") expect_match(tail(out, n = 1), "57 2015-03-15 12:00:00 178.5000 -33.799999 28 -4 37 98200 99300") - out <- capture_output_lines(show(sts_nc)) + out <- capture_output_lines(sp::show(sts_nc)) # Check that the Storm output is correct expect_match(out[3], "Number of storms: 7 ") expect_match(out[7], "Name: PAM") @@ -375,12 +375,12 @@ test_that("Test convert loi function", { sr2 <- sp::Polygon(rbind(c(180, 0), c(290, 0), c(290, 60), c(180, 60), c(180, 0)), hole = TRUE) srs1 <- sp::Polygons(list(sr1), "s1") srs2 <- sp::Polygons(list(sr2), "s2") - spP <- sp::SpatialPolygons(list(srs1, srs2), 1:2, proj4string = CRS(as.character("wgs84"))) + spP <- sp::SpatialPolygons(list(srs1, srs2), 1:2, proj4string = sp::CRS(as.character("wgs84"))) centroids <- sp::coordinates(spP) x <- centroids[, 1] y <- centroids[, 2] z <- 1.4 + 0.1 * x + 0.2 * y + 0.002 * x * x - test <- SpatialPolygonsDataFrame(spP, + test <- sp::SpatialPolygonsDataFrame(spP, data = data.frame(x = x, y = y, z = z, row.names = row.names(spP)) ) expect_identical(sf::st_crs(convertLoi(test))$input, "EPSG:4326")