diff --git a/R/compare_covariates.R b/R/compare_covariates.R index 80cc3f6..36c959c 100644 --- a/R/compare_covariates.R +++ b/R/compare_covariates.R @@ -18,7 +18,7 @@ #' @export #' @references Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). From here and now to there and then: Practical recommendations for extrapolating cetacean density surface models to novel conditions. CREEM Technical Report 2019-01, 59 p. \href{https://research-repository.st-andrews.ac.uk/handle/10023/18509}{https://research-repository.st-andrews.ac.uk/handle/10023/18509} #' -#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} #' #' @examples #' library(dsmextra) diff --git a/R/compute_extrapolation.R b/R/compute_extrapolation.R index f26bd55..80e424a 100644 --- a/R/compute_extrapolation.R +++ b/R/compute_extrapolation.R @@ -45,7 +45,7 @@ #' #' Broennimann O, Di Cola V, Guisan A (2016). ecospat: Spatial Ecology Miscellaneous Methods. R package version 2.1.1. \href{https://CRAN.R-project.org/package=ecospat}{https://CRAN.R-project.org/package=ecospat} #' -#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-115. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} #' #' Miller DL, Rexstad E, Burt L, Bravington MV, Hedley S (2015). dsm: Density Surface Modelling of Distance Sampling Data. R package version 2.2.9. \href{https://CRAN.R-project.org/package=dsm}{https://CRAN.R-project.org/package=dsm} #' @export @@ -81,6 +81,9 @@ #' library(sp) #' library(magrittr) #' +#' # Native and introduced range +#' data(acacia) +#' #' # Download BioClim data #' r <- raster::getData(name = "worldclim", var = "bio", res = 10) #' @@ -88,13 +91,13 @@ #' bioclim.variables <- c("bio1", "bio5", "bio6", "bio12", "bio13", "bio14") #' #' # Reference system (South Australia) -#' ref <- raster::crop(x = r[[bioclim.variables]], y = south_australia) %>% -#' raster::mask(x = ., mask = south_australia) %>% +#' ref <- raster::crop(x = r[[bioclim.variables]], y = acacia$south_australia) %>% +#' raster::mask(x = ., mask = acacia$south_australia) %>% #' raster::as.data.frame(x = ., xy = TRUE, na.rm = TRUE) #' #' # Target system (South Africa) -#' target <- raster::crop(x = r[[bioclim.variables]], y = south_africa) %>% -#' raster::mask(x = ., mask = south_africa) %>% +#' target <- raster::crop(x = r[[bioclim.variables]], y = acacia$south_africa) %>% +#' raster::mask(x = ., mask = acacia$south_africa) %>% #' raster::as.data.frame(., xy = TRUE, na.rm = TRUE) #' #' # Assess extrapolation diff --git a/R/dsmextra-package.R b/R/dsmextra-package.R index ca233fe..ac268f1 100644 --- a/R/dsmextra-package.R +++ b/R/dsmextra-package.R @@ -28,9 +28,9 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c(".")) #' #' NOAA Northeast Fisheries Science Center (2004). Report on the 2004 Mid-Atlantic Marine Mammal Shipboard Abundance Survey aboard the R/V Endeavor, Cruise No. EN 04-395/396. #' -#' Palka, DL 2012. Cetacean abundance estimates in US northwestern Atlantic Ocean waters from summer 2011 line transect survey. Northeast Fisheries Science Center Reference Document 12-29, 37 p. +#' Palka DL (2012). Cetacean abundance estimates in US northwestern Atlantic Ocean waters from summer 2011 line transect survey. Northeast Fisheries Science Center Reference Document 12-29, 37 p. #' -#' Palka, DL 2006 Summer abundance estimates of cetaceans in US North Atlantic Navy operating areas. Northeast Fisheries Science Center Reference Document 06-03, 41 p. +#' Palka DL (2006) Summer abundance estimates of cetaceans in US North Atlantic Navy operating areas. Northeast Fisheries Science Center Reference Document 06-03, 41 p. #' #' @format A list of two #' \describe{ @@ -43,3 +43,25 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c(".")) #' @source Data provided by Debi Palka (NOAA North East Fisheries Science Center) and Lance Garrison (NOAA South East Fisheries Science Center). Initial data processing by Jason Roberts (Marine Geospatial Ecology Lab, Duke University). A subset of the data are held and described on OBIS-SEAMAP at: \url{http://seamap.env.duke.edu/dataset/396}. #' @keywords datasets NULL + + +#' Native and introduced range of Acacia cyclops +#' +#' Spatial extents of the native and introduced ranges of A. cyclops, a small shrub species. +#' +#'#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/j.1472-4642.2011.00811.x}{10.1111/j.1472-4642.2011.00811.x} +#' +#' Webber BL, Yates, CJ, Le Maitre DC, Scott JK, Kriticos DJ, Ota N, McNeill A, Le Roux JJ, Midgley GF (2011). Modelling horses for novel climate courses: Insights from projecting potential distributions of native and alien Australian acacias with correlative and mechanistic models. Diversity and Distributions, 17: 978–1000. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +#' +#' @format A list of two +#' \describe{ +#' \item{south_australia}{\code{SpatialPolygonsDataFrame} of the native range (reference area).} +#' \item{south_africa}{\code{SpatialPolygonsDataFrame} of the introduced range (target area).} +#' } +#' +#' @name acacia +#' @docType data +#' @source Sample data from the ExDet tutorial available from https://www.climond.org/ExDet.aspx. +#' @keywords datasets +NULL + diff --git a/R/extrapolation_analysis.R b/R/extrapolation_analysis.R index 28328f3..3766809 100644 --- a/R/extrapolation_analysis.R +++ b/R/extrapolation_analysis.R @@ -28,7 +28,7 @@ #' @author Phil J. Bouchet #' @references Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). From here and now to there and then: Practical recommendations for extrapolating cetacean density surface models to novel conditions. CREEM Technical Report 2019-01, 59 p. \href{https://research-repository.st-andrews.ac.uk/handle/10023/18509}{https://research-repository.st-andrews.ac.uk/handle/10023/18509} #' -#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} #' #' @examples #' library(dsmextra) diff --git a/R/globals.R b/R/globals.R index e8d4d66..1e5bd58 100644 --- a/R/globals.R +++ b/R/globals.R @@ -1,2 +1,2 @@ utils::globalVariables(c("mic_combinatorial", "Freq", "label", "value", "nvars", "type", "ypos", "var", - "x", "y", "mic", "Type", "Count", "Percentage", "covariate", "perc", "freq", "obs", "transects", "south_australia", "south_africa")) + "x", "y", "mic", "Type", "Count", "Percentage", "covariate", "perc", "freq")) diff --git a/data/acacia.rda b/data/acacia.rda new file mode 100644 index 0000000..e123c6d Binary files /dev/null and b/data/acacia.rda differ diff --git a/man/acacia.Rd b/man/acacia.Rd new file mode 100644 index 0000000..c393bbe --- /dev/null +++ b/man/acacia.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dsmextra-package.R +\docType{data} +\name{acacia} +\alias{acacia} +\title{Native and introduced range of Acacia cyclops} +\format{ +A list of two +\describe{ + \item{south_australia}{\code{SpatialPolygonsDataFrame} of the native range (reference area).} + \item{south_africa}{\code{SpatialPolygonsDataFrame} of the introduced range (target area).} +} +} +\source{ +Sample data from the ExDet tutorial available from https://www.climond.org/ExDet.aspx. +} +\description{ +Spatial extents of the native and introduced ranges of A. cyclops, a small shrub species. +} +\details{ +#' Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/j.1472-4642.2011.00811.x}{10.1111/j.1472-4642.2011.00811.x} + +Webber BL, Yates, CJ, Le Maitre DC, Scott JK, Kriticos DJ, Ota N, McNeill A, Le Roux JJ, Midgley GF (2011). Modelling horses for novel climate courses: Insights from projecting potential distributions of native and alien Australian acacias with correlative and mechanistic models. Diversity and Distributions, 17: 978–1000. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +} +\keyword{datasets} diff --git a/man/compare_covariates.Rd b/man/compare_covariates.Rd index 137c671..5bc9829 100644 --- a/man/compare_covariates.Rd +++ b/man/compare_covariates.Rd @@ -75,7 +75,7 @@ compare_covariates(extrapolation.type = "both", \references{ Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). From here and now to there and then: Practical recommendations for extrapolating cetacean density surface models to novel conditions. CREEM Technical Report 2019-01, 59 p. \href{https://research-repository.st-andrews.ac.uk/handle/10023/18509}{https://research-repository.st-andrews.ac.uk/handle/10023/18509} -Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} } \seealso{ \code{\link{compute_extrapolation}}, \code{\link{summarise_extrapolation}} diff --git a/man/compute_extrapolation.Rd b/man/compute_extrapolation.Rd index a476fb1..6af3d63 100644 --- a/man/compute_extrapolation.Rd +++ b/man/compute_extrapolation.Rd @@ -87,6 +87,9 @@ library(raster) library(sp) library(magrittr) +# Native and introduced range +data(acacia) + # Download BioClim data r <- raster::getData(name = "worldclim", var = "bio", res = 10) @@ -94,13 +97,13 @@ r <- raster::getData(name = "worldclim", var = "bio", res = 10) bioclim.variables <- c("bio1", "bio5", "bio6", "bio12", "bio13", "bio14") # Reference system (South Australia) -ref <- raster::crop(x = r[[bioclim.variables]], y = south_australia) \%>\% -raster::mask(x = ., mask = south_australia) \%>\% +ref <- raster::crop(x = r[[bioclim.variables]], y = acacia$south_australia) \%>\% +raster::mask(x = ., mask = acacia$south_australia) \%>\% raster::as.data.frame(x = ., xy = TRUE, na.rm = TRUE) # Target system (South Africa) -target <- raster::crop(x = r[[bioclim.variables]], y = south_africa) \%>\% -raster::mask(x = ., mask = south_africa) \%>\% +target <- raster::crop(x = r[[bioclim.variables]], y = acacia$south_africa) \%>\% +raster::mask(x = ., mask = acacia$south_africa) \%>\% raster::as.data.frame(., xy = TRUE, na.rm = TRUE) # Assess extrapolation @@ -121,7 +124,7 @@ Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). Fr Broennimann O, Di Cola V, Guisan A (2016). ecospat: Spatial Ecology Miscellaneous Methods. R package version 2.1.1. \href{https://CRAN.R-project.org/package=ecospat}{https://CRAN.R-project.org/package=ecospat} -Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-115. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} Miller DL, Rexstad E, Burt L, Bravington MV, Hedley S (2015). dsm: Density Surface Modelling of Distance Sampling Data. R package version 2.2.9. \href{https://CRAN.R-project.org/package=dsm}{https://CRAN.R-project.org/package=dsm} } diff --git a/man/extrapolation_analysis.Rd b/man/extrapolation_analysis.Rd index 86b9aad..8c236b3 100644 --- a/man/extrapolation_analysis.Rd +++ b/man/extrapolation_analysis.Rd @@ -103,7 +103,7 @@ spermw.analysis <- extrapolation_analysis(samples = segs, \references{ Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). From here and now to there and then: Practical recommendations for extrapolating cetacean density surface models to novel conditions. CREEM Technical Report 2019-01, 59 p. \href{https://research-repository.st-andrews.ac.uk/handle/10023/18509}{https://research-repository.st-andrews.ac.uk/handle/10023/18509} -Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159, DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} +Mesgaran MB, Cousens RD, Webber BL (2014). Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models. Diversity & Distributions, 20: 1147-1159. DOI: \href{https://onlinelibrary.wiley.com/doi/full/10.1111/ddi.12209}{10.1111/ddi.12209} } \author{ Phil J. Bouchet diff --git a/man/spermwhales.Rd b/man/spermwhales.Rd index 2c06595..55a72c1 100644 --- a/man/spermwhales.Rd +++ b/man/spermwhales.Rd @@ -25,8 +25,8 @@ NOAA Northeast Fisheries Science Center (2004). A survey for abundance and distr NOAA Northeast Fisheries Science Center (2004). Report on the 2004 Mid-Atlantic Marine Mammal Shipboard Abundance Survey aboard the R/V Endeavor, Cruise No. EN 04-395/396. -Palka, DL 2012. Cetacean abundance estimates in US northwestern Atlantic Ocean waters from summer 2011 line transect survey. Northeast Fisheries Science Center Reference Document 12-29, 37 p. +Palka DL (2012). Cetacean abundance estimates in US northwestern Atlantic Ocean waters from summer 2011 line transect survey. Northeast Fisheries Science Center Reference Document 12-29, 37 p. -Palka, DL 2006 Summer abundance estimates of cetaceans in US North Atlantic Navy operating areas. Northeast Fisheries Science Center Reference Document 06-03, 41 p. +Palka DL (2006) Summer abundance estimates of cetaceans in US North Atlantic Navy operating areas. Northeast Fisheries Science Center Reference Document 06-03, 41 p. } \keyword{datasets}