From f78b51987197fbc04fa5e5027ab8ab7e157fe423 Mon Sep 17 00:00:00 2001 From: "Ian Buller, PhD, MA" Date: Wed, 23 Mar 2022 23:59:24 -0400 Subject: [PATCH] Prepare for CRAN v0.1.13 release * In the `div_plot()` and `seq_plot()` internal functions, replaced `if (class(input) == "im")` with `if (methods::is(input, "im"))` * Added `methods` package to Imports * Re-added `utils` package to Suggests because "zzz.R" calls the `packageDescription()` function * Moved `spatstat.random` package from Imports to Suggests because the `rpoispp()` function is only used for tests --- CRAN-SUBMISSION | 3 +++ DESCRIPTION | 8 +++++--- NAMESPACE | 2 +- NEWS.md | 6 ++++++ R/div_plot.R | 3 ++- R/lrren.R | 4 ++-- R/package.R | 4 ++-- R/perlrren.R | 4 ++-- R/plot_perturb.R | 1 - R/seq_plot.R | 3 ++- cran-comments.md | 18 ++++++++++++------ man/lrren.Rd | 4 ++-- man/perlrren.Rd | 4 ++-- 13 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION new file mode 100644 index 0000000..f64b802 --- /dev/null +++ b/CRAN-SUBMISSION @@ -0,0 +1,3 @@ +Version: 0.1.12 +Date: 2022-03-23 21:37:00 UTC +SHA: 00e8d585e836e9e9044f1b14adec291e13c34695 diff --git a/DESCRIPTION b/DESCRIPTION index 97d5f37..91408c7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: envi Type: Package Title: Environmental Interpolation using Spatial Kernel Density Estimation -Version: 0.1.12 +Version: 0.1.13 Date: 2022-03-23 Authors@R: c(person(given = "Ian D.", @@ -43,6 +43,7 @@ Imports: graphics, grDevices, iterators, + methods, pls, raster, rgeos, @@ -50,13 +51,14 @@ Imports: sp, sparr, spatstat.geom, - spatstat.random, stats Suggests: R.rsp, spatstat.data, + spatstat.random, spelling, - testthat + testthat, + utils VignetteBuilder: R.rsp Language: en-US URL: https://github.com/Waller-SUSAN/envi diff --git a/NAMESPACE b/NAMESPACE index 476efb8..931112f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -33,6 +33,7 @@ importFrom(graphics,plot) importFrom(graphics,plot.new) importFrom(graphics,title) importFrom(iterators,icount) +importFrom(methods,is) importFrom(pls,cvsegments) importFrom(raster,crs) importFrom(raster,cut) @@ -62,7 +63,6 @@ importFrom(spatstat.geom,ppp) importFrom(spatstat.geom,rjitter) importFrom(spatstat.geom,setmarks) importFrom(spatstat.geom,superimpose) -importFrom(spatstat.random,rpoispp) importFrom(stats,median) importFrom(stats,na.omit) importFrom(stats,sd) diff --git a/NEWS.md b/NEWS.md index 25f1078..49b7deb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # envi (development version) +# envi v0.1.13 +* In the `div_plot()` and `seq_plot()` internal functions, replaced `if (class(input) == "im")` with `if (methods::is(input, "im"))` +* Added `methods` package to Imports +* Re-added `utils` package to Suggests because "zzz.R" calls the `packageDescription()` function +* Moved `spatstat.random` package from Imports to Suggests because the `rpoispp()` function is only used for tests + # envi v0.1.12 * Fixed bug in `perlrren()` function that will now keep the predicted values even if NA * Fixed bug in `plot_perturb()` function that will now project rasters using `method = "bilinear"` for continuous values diff --git a/R/div_plot.R b/R/div_plot.R index 6e8ecfe..7fdcd78 100644 --- a/R/div_plot.R +++ b/R/div_plot.R @@ -20,6 +20,7 @@ #' } #' #' @importFrom grDevices colorRampPalette +#' @importFrom methods is #' @importFrom raster raster #' #' @keywords internal @@ -32,7 +33,7 @@ div_plot <- function(input, digits = 1) { # Inputs - if (class(input) == "im") { + if (methods::is(input, "im")) { out <- raster::raster(input) } else { out <- input } diff --git a/R/lrren.R b/R/lrren.R index 3b06dca..daa1e3c 100644 --- a/R/lrren.R +++ b/R/lrren.R @@ -95,8 +95,8 @@ #' # Presence data #' presence <- spatstat.data::bei #' spatstat.geom::marks(presence) <- data.frame("presence" = rep(1, presence$n), -#' "lon" = presence$x, -#' "lat" = presence$y) +#' "lon" = presence$x, +#' "lat" = presence$y) #' spatstat.geom::marks(presence)$elev <- elev[presence] #' spatstat.geom::marks(presence)$grad <- grad[presence] #' diff --git a/R/package.R b/R/package.R index d1ec682..9033750 100644 --- a/R/package.R +++ b/R/package.R @@ -49,12 +49,12 @@ NULL #' @importFrom graphics abline layout legend lines mtext par plot plot.new title #' @importFrom grDevices chull colorRampPalette #' @importFrom iterators icount +#' @importFrom methods is #' @importFrom pls cvsegments #' @importFrom raster crs cut extract image projectRaster raster rasterToPoints reclassify values #' @importFrom rgeos gBuffer #' @importFrom ROCR performance prediction #' @importFrom sp bbox coordinates CRS gridded Polygon Polygons SpatialPolygons -#' @importFrom stats median na.omit sd #' @importFrom spatstat.geom as.solist im.apply marks owin pixellate plot.ppp ppp rjitter setmarks superimpose -#' @importFrom spatstat.random rpoispp +#' @importFrom stats median na.omit sd NULL diff --git a/R/perlrren.R b/R/perlrren.R index 19f647c..a40eb06 100644 --- a/R/perlrren.R +++ b/R/perlrren.R @@ -77,8 +77,8 @@ #' # Presence data #' presence <- spatstat.data::bei #' spatstat.geom::marks(presence) <- data.frame("presence" = rep(1, presence$n), -#' "lon" = presence$x, -#' "lat" = presence$y) +#' "lon" = presence$x, +#' "lat" = presence$y) #' #' # (Pseudo-)Absence data #' absence <- spatstat.random::rpoispp(0.008, win = ims[[1]]) diff --git a/R/plot_perturb.R b/R/plot_perturb.R index bebff30..7871495 100644 --- a/R/plot_perturb.R +++ b/R/plot_perturb.R @@ -22,7 +22,6 @@ #' @importFrom raster crs raster projectRaster #' @importFrom sp CRS #' @importFrom spatstat.geom pixellate -#' @importFrom spatstat.random rpoispp #' #' @export #' diff --git a/R/seq_plot.R b/R/seq_plot.R index 34fbfb5..1bdc032 100644 --- a/R/seq_plot.R +++ b/R/seq_plot.R @@ -18,6 +18,7 @@ #' } #' #' @importFrom grDevices colorRampPalette +#' @importFrom methods is #' #' @keywords internal #' @@ -27,7 +28,7 @@ seq_plot <- function(input, digits = 1) { # Inputs - if (class(input) == "im") { + if (methods::is(input, "im")) { out <- raster::raster(input) } else { out <- input } diff --git a/cran-comments.md b/cran-comments.md index 6fd525f..e3d8655 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,12 +1,18 @@ -## This is the twelfth resubmission +## This is the thirteenth resubmission +* Actions taken regarding feedback from CRAN teams' auto-check service: + * In the `div_plot()` and `seq_plot()` internal functions, replaced `if (class(input) == "im")` with `if (methods::is(input, "im"))` + * Added `methods` package to Imports + * Updates since previous submission: - * Fixed bug in `perlrren()` function that will now keep the predicted values even if NA - * Fixed bug in `plot_perturb()` function that will now project rasters using `method = "bilinear"` for continuous values - * Streamlined "test-perlrren.R" by removing duplicate tests for "incorrectly specified n_sim" - * Fixed bug in "test-plot_cv.R" by resetting the graphics within an error check to clear a warning between tests + * Re-added `utils` package to Suggests because "zzz.R" calls the `packageDescription()` function + * Moved `spatstat.random` package from Imports to Suggests because the `rpoispp()` function is only used for tests -* Documentation for `pval_correct()` references a doi that throws a NOTE but is a valid URL +* Documentation for "man/envi-packge", man/pval_correct.Rd", and DESCRIPTION references the following DOIs, which throws a NOTE but are valid URLs: + * + * + * + * ## Test environments * local OS X install, R 4.1.2 diff --git a/man/lrren.Rd b/man/lrren.Rd index dd40c7a..9d0afc6 100644 --- a/man/lrren.Rd +++ b/man/lrren.Rd @@ -119,8 +119,8 @@ if (interactive()) { # Presence data presence <- spatstat.data::bei spatstat.geom::marks(presence) <- data.frame("presence" = rep(1, presence$n), - "lon" = presence$x, - "lat" = presence$y) + "lon" = presence$x, + "lat" = presence$y) spatstat.geom::marks(presence)$elev <- elev[presence] spatstat.geom::marks(presence)$grad <- grad[presence] diff --git a/man/perlrren.Rd b/man/perlrren.Rd index e72da84..ab84131 100644 --- a/man/perlrren.Rd +++ b/man/perlrren.Rd @@ -101,8 +101,8 @@ if (interactive()) { # Presence data presence <- spatstat.data::bei spatstat.geom::marks(presence) <- data.frame("presence" = rep(1, presence$n), - "lon" = presence$x, - "lat" = presence$y) + "lon" = presence$x, + "lat" = presence$y) # (Pseudo-)Absence data absence <- spatstat.random::rpoispp(0.008, win = ims[[1]])