Skip to content

Commit

Permalink
Prepare for CRAN v0.2.6 Release
Browse files Browse the repository at this point in the history
* Replaced `if()` conditions comparing `class()` to string with `inherits()`
* Added `future::plan(future::multisession)` in tests to remove the files in temp directory
* Updated maintainer contact information
  • Loading branch information
Ian Buller, PhD, MA committed Dec 1, 2022
1 parent 8105ea0 commit 92cda75
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ rsconnect/

# Sandboxes
inst/doc

# CRAN
CRAN-SUBMISSION
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: sparrpowR
Title: Power Analysis to Detect Spatial Relative Risk Clusters
Version: 0.2.5
Date: 2022-02-04
Version: 0.2.6
Date: 2022-12-01
Authors@R:
c(person(given = "Ian D.",
family = "Buller",
role = c("aut", "cre", "cph"),
email = "ian.buller@nih.gov",
email = "ian.buller@alumni.emory.edu",
comment = c(ORCID = "0000-0001-9477-8582")),
person(given = "Derek W.",
family = "Brown",
role = c("aut", "cph"),
email = "[email protected]",
email = "[email protected]",
comment = c(ORCID = "0000-0001-8393-1713")),
person(given = "Mitchell J.",
family = "Machiela",
Expand All @@ -24,18 +24,18 @@ Authors@R:
email = "[email protected]"),
person(given = "NCI",
role = c("cph", "fnd")))
Maintainer: Ian D. Buller <ian.buller@nih.gov>
Maintainer: Ian D. Buller <ian.buller@alumni.emory.edu>
Description: Calculate the statistical power to detect clusters using kernel-based
spatial relative risk functions that are estimated using the 'sparr' package.
Details about the 'sparr' package methods can be found in the tutorial: Davies
et al. (2018) <doi:10.1002/sim.7577>. Details about kernel density estimation
can be found in J. F. Bithell (1990) <doi:10.1002/sim.4780090616>. More
et al. (2018) <doi:10.1002/sim.7577>. Details about kernel density estimation
can be found in J. F. Bithell (1990) <doi:10.1002/sim.4780090616>. More
information about relative risk functions using kernel density estimation can
be found in J. F. Bithell (1991) <doi:10.1002/sim.4780101112>.
License: Apache License (>= 2.0)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.2.1
Depends:
R (>= 3.5.0),
Imports:
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# sparrpowR (development version)

# sparrpowR v0.2.6
* Replaced `if()` conditions comparing `class()` to string with `inherits()`
* Added `future::plan(future::multisession)` in tests to remove the files in temp directory
* Updated maintainer contact information

# sparrpowR v0.2.5
* Updated dependencies `spatstat.core` and `spatstat.linnet` packages based on feedback from the Spatstat Team (Adrian Baddeley and Ege Rubak). All random generators in `spatstat.core` were moved to a new package `spatstat.random`
* `spatstat.geom`, `spatstat.core`, `spatstat.linnet`, and `spatstat (>=2.0-0)` are no longer Depends.
Expand Down
4 changes: 2 additions & 2 deletions R/jitter_power.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @param obs_data A bivariate point pattern (a multitype point pattern of object of class "ppp") with two types of points in a factor valued mark.
#' @param sim_total Integer, specifying the number of simulation iterations to perform.
#' @param samp_control Character string specifying whether to randomize the control locations uniformly (\code{samp_control="uniform"}), with complete spatial randomness (\code{samp_control="CSR"}), or multivariate normal (\code{samp_control="MVN"}).
#' @param s_control Optional. Numeric value for the standard deviation of the multivariate normal distribution in the units of the \code{obs_data}. The default value (1) assumes a unit square window. Ignored if Ignored if \code{samp_control="uniform"} or \code{samp_control="CSR"}.
#' @param s_control Optional. Numeric value for the standard deviation of the multivariate normal distribution in the units of the \code{obs_data}. The default value (1) assumes a unit square window. Ignored if Ignored if \code{samp_control="uniform"} or \code{samp_control="CSR"}.
#' @param alpha Optional. Numeric value of the critical p-value (default=0.05).
#' @param p_correct Optional. Character string specifying whether to apply a correction for multiple comparisons including a False Discovery Rate \code{p_correct = "FDR"}, a Sidak correction \code{p_correct = "uncorrelated Sidak"}, and a Bonferroni correction \code{p_correct = "uncorrelated Bonferroni"}. If \code{p_correct = "none"} (the default), then no correction is applied.
#' @param parallel Logical. If TRUE, will execute the function in parallel. If FALSE (the default), will not execute the function in parallel.
Expand Down Expand Up @@ -97,7 +97,7 @@ jitter_power <- function(obs_data,
}

# Input
if (class(obs_data) != "ppp"){
if (!inherits(obs_data, "ppp")) {
stop("Argument 'obs_data' must be of class 'ppp'")
}

Expand Down
4 changes: 2 additions & 2 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Computes the statistical power for the spatial relative risk function.
#'
#' @details For a two-group comparison (e.g., cases v. controls) the 'sparrpowR' package calculates the statistical power to detect clusters using the kernel-based spatial relative risk function that is estimated using the 'sparr' package. Details about the 'sparr' package methods can be found in the tutorial: Davies et al. (2018) \doi{10.1002/sim.7577}. Details about kernel density estimation can be found in J. F. Bithell (1990) \doi{10.1002/sim.4780090616}. More information about relative risk functions using kernel density estimation can be found in J. F. Bithell (1991) \doi{10.1002/sim.4780101112}.
#' @details For a two-group comparison (e.g., cases v. controls) the 'sparrpowR' package calculates the statistical power to detect clusters using the kernel-based spatial relative risk function that is estimated using the 'sparr' package. Details about the 'sparr' package methods can be found in the tutorial: Davies et al. (2018) \doi{10.1002/sim.7577}. Details about kernel density estimation can be found in J. F. Bithell (1990) \doi{10.1002/sim.4780090616}. More information about relative risk functions using kernel density estimation can be found in J. F. Bithell (1991) \doi{10.1002/sim.4780101112}.
#'
#' This package provides a function to compute the statistical power for the spatial relative risk function with various theoretical spatial sampling strategies. The 'sparrpowR' package also provides a function to compute the statistical power for the spatial relative risk function for scenarios where one group (e.g., cases) have been observed and a theoretical sampling strategy for the second group (e.g., controls) is desired. The 'sparrpowR' package also provides visualization of data and statistical power.
#'
Expand Down Expand Up @@ -31,7 +31,7 @@
#' @author Ian D. Buller\cr \emph{Occupational and Environmental Epidemiology Branch, Division of Cancer Epidemiology and Genetics, National Cancer Institute, National Institutes of Health, Rockville, Maryland, USA.} \cr\cr
#' Derek W. Brown\cr \emph{Integrative Tumor Epidemiology Branch, Division of Cancer Epidemiology and Genetics, National Cancer Institute, National Institutes of Health, Rockville, Maryland, USA.}
#'
#' Maintainer: I.D.B. \email{ian.buller@@nih.gov}
#' Maintainer: I.D.B. \email{ian.buller@@alumni.emory.edu.gov}
#'
#' @keywords package
NULL
Expand Down
6 changes: 3 additions & 3 deletions R/spatial_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @param y_control Numeric value, or numeric vector, of y-coordinate(s) of case cluster(s). Ignored if \code{samp_control != "MVN"}.
#' @param r_case Optional. Numeric value, or numeric vector, of radius (radii) of case cluster(s) in the units of \code{win}. Ignored if \code{samp_case = "MVN"}.
#' @param r_control Optional. Numeric value, or numeric vector, of radius (radii) of control cluster(s) in the units of \code{win}. Ignored if \code{samp_control != "clustered"}.
#' @param s_case Optional. Numeric value, or numeric vector, for the standard deviation(s) of the multivariate normal distribution for case locations in the units of \code{win}. Ignored if \code{samp_control != "MVN"}.
#' @param s_case Optional. Numeric value, or numeric vector, for the standard deviation(s) of the multivariate normal distribution for case locations in the units of \code{win}. Ignored if \code{samp_control != "MVN"}.
#' @param s_control Optional. Numeric value, or numeric vector, for the standard deviation(s) of the multivariate normal distribution for control locations in the units of \code{win}. Ignored if \code{samp_control != "MVN"}.
#' @param l_case Optional. A single positive number, a vector of positive numbers, a function(x,y, ...), or a pixel image. Intensity of the Poisson process for case clusters. Ignored if \code{samp_control != "IPP"}.
#' @param l_control Optional. A single positive number, a vector of positive numbers, a function(x,y, ...), or a pixel image. Intensity of the Poisson process for control clusters. Ignored if \code{samp_control = "uniform"}, \code{samp_control = "systematic"}, \code{samp_control = "MVN"}, or \code{samp_control = "CSR"}.
Expand Down Expand Up @@ -158,7 +158,7 @@ spatial_data <- function(win = spatstat.geom::unit.square(),
}

if (samp_case == "IPP"){
if (class(lamb) != "function") {
if (!inherits(lamb, "function")) {
stop("The argument 'l_case' should be an intensity function")
}
win_case <- spatstat.geom::disc(radius = rad, centre = c(0.5, 0.5), ...)
Expand Down Expand Up @@ -194,7 +194,7 @@ spatial_data <- function(win = spatstat.geom::unit.square(),
}

if (samp_control == "IPP") {
if (class(lamb) != "function") {
if (!inherits(lamb, "function")) {
stop("The argument 'l_control' should be an intensity function")
}
x <- spatstat.random::rpoispp(lambda = lamb, win = wind, ...)
Expand Down
4 changes: 2 additions & 2 deletions R/spatial_power.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ spatial_power <- function(win = spatstat.geom::unit.square(),
}

if (samp_case == "IPP") {
if (class(lamb) != "function") {
if (!inherits(lamb, "function")) {
stop("The argument 'l_case' should be an intensity function")
}
win_case <- spatstat.geom::disc(radius = rad, centre = c(0.5, 0.5), ...)
Expand Down Expand Up @@ -253,7 +253,7 @@ spatial_power <- function(win = spatstat.geom::unit.square(),
}

if (samp_control == "IPP") {
if (class(lamb) != "function") {
if (!inherits(lamb, "function")) {
stop("The argument 'l_control' should be an intensity function")
}
x <- spatstat.random::rpoispp(lambda = lamb, win = win, ...)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ sparrpowR: Power analysis to detect spatial relative clusters <img src="man/figu
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/sparrpowR?color=blue)](https://r-pkg.org/pkg/sparrpowR)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![GitHub last commit](https://img.shields.io/github/last-commit/machiela-lab/sparrpowR)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5347998.svg)](https://doi.org/10.5281/zenodo.5347998)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5347997.svg)](https://doi.org/10.5281/zenodo.5347997)
<!-- badges: end -->

**Date repository last updated**: August 08, 2022
**Date repository last updated**: December 01, 2022

<h2 id="overview">

Expand Down Expand Up @@ -202,4 +202,4 @@ When citing this package for publication, please follow:

### Questions? Feedback?

For questions about the package please contact the maintainer [Dr. Ian D. Buller](mailto:ian.buller@nih.gov) or [submit a new issue](https://github.com/machiela-lab/sparrpowR/issues).
For questions about the package please contact the maintainer [Dr. Ian D. Buller](mailto:ian.buller@alumni.emory.edu) or [submit a new issue](https://github.com/machiela-lab/sparrpowR/issues).
13 changes: 5 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
## This is the ninth resubmission
## This is the tenth resubmission

* Actions taken since previous submission:
* Updated dependencies `spatstat.core` and `spatstat.linnet` packages based on feedback from the Spatstat Team (Adrian Baddeley and Ege Rubak). All random generators in `spatstat.core` were moved to a new package `spatstat.random`
* `spatstat.geom`, `spatstat.core`, `spatstat.linnet`, and `spatstat (>=2.0-0)` are no longer Depends
* `spatstat.geom` and `spatstat.random` are now Imports
* `spatstat.data` is now Suggests
* [See the GitHub merge pull request](https://github.com/machiela-lab/sparrpowR/commit/4df5d85343dd222c9d4b1ae30f894ed6482bcb52)
* Fixed annotation typos in the `pval_correct()` function
* Replaced `if()` conditions comparing `class()` to string with `inherits()`
* Added `future::plan(future::multisession)` in tests to remove the files in temp directory
* Updated maintainer contact information

* Documentation for `pval_correct()` references a doi <https://doi.org/10.2307/2283989> that throws a NOTE but is a valid URL

## Test environments
* local OS X install, R 4.1.2
* local OS X install, R 4.2.1
* win-builder, (devel, release, oldrelease)
* Rhub
* Fedora Linux, R-devel, clang, gfortran
Expand Down
2 changes: 1 addition & 1 deletion man/jitter_power.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/sparrpowR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/spatial_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ library(sparrpowR)
options(parallelly.makeNodePSOCK.setup_strategy = "sequential")

test_check("sparrpowR")
future::plan(future::sequential)

0 comments on commit 92cda75

Please sign in to comment.