From f05ff992e9244f135037a41239ccd79824d17306 Mon Sep 17 00:00:00 2001 From: Phil Bouchet Date: Thu, 30 Jul 2020 16:13:33 +0100 Subject: [PATCH] Add acacia dataset --- R/compare_covariates.R | 2 +- R/compute_extrapolation.R | 13 ++++++++----- R/dsmextra-package.R | 26 ++++++++++++++++++++++++-- R/extrapolation_analysis.R | 2 +- R/globals.R | 2 +- data/acacia.rda | Bin 0 -> 3759 bytes man/acacia.Rd | 25 +++++++++++++++++++++++++ man/compare_covariates.Rd | 2 +- man/compute_extrapolation.Rd | 13 ++++++++----- man/extrapolation_analysis.Rd | 2 +- man/spermwhales.Rd | 4 ++-- 11 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 data/acacia.rda create mode 100644 man/acacia.Rd 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 0000000000000000000000000000000000000000..e123c6da370702bf0c2979f4b903b7f6e858c8d9 GIT binary patch literal 3759 zcmV;g4p8wzT4*^jL0KkKS^k)a-vAmcfB*mg{`KSi|NsB`{@?%q|NnMz>-@{x>t6eu z-!k9(bGzUZ{|D3SX5`QS1VDTM003t9uw*PWBU}{!F+)u~1bUyTKh-Cxv?gi;Pbhkr38OTR)fhlD0iXa6P{amJ8foeVn3`#z#2R`- zAVHvL20@T$8U~C^jRQaiAOk?c8Z-?6001-wMvVXf007aElO`sBWYL0C%2Jg*LA3w? z0009(G|&J50009Z0Av6F00000000001`=sh-jbB{5&D{gK+rS*0qOu~000000001O zAOHXW00000000JpDpN@(>Yt{j|58#1y;Su*N0Br)svf3;MxLO0hM5M@9;fO|Kx7&j z15Z!~rl37Rk&pl|fMnA_pdO>t(jrbeUDPiP6L`lq6L zf$C_@4^+qjqtw$QMvXMYG-xsa(8wBTriMdCfuI4P0LaL~dpEeB0Ur#z!{@J2Hrr;_ z(`?#pw%c26w$|HewY9aj=~`YRmhHGNxNzT&;=S$6pUmSvCAw}+)o!NZ+^yBP-8W6r z+&3GWjn?MlblkUAt}^CfT9nAPVB)PZJWO4^u;nSPnw6=j)YXoCd5^JrlbHJ{>aRsS zx26u9Qq)tZ70{!86jv+PC@R$B*1$<*w{|>7EHT}-WlY9aF^a<(F_}CEf*x{4FauGN z7cDtX&ZyCkf93d|3zy^R{!rd=@;qlNorh-Rla&z_Sq4TYDiF07i-w_&UyJhVS+&Ys zp{A+P#+eU0iX>{Pqs&zTnLMk{UThkM426`1@1zYvL7I`^NRy`VUl@lYB*f!ZIyxhV z1y_divz+O}fqQ@lHuRj&A-N|5!;VbO5S;u1LTLqr0x2Z6aZ8z!aBQh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NBhzWvzpmmwiQ1 z(%B-yq^Phf3g%@p88M-1QDB*waM(pr%K>e%L3Z0SNFpL+V6i!_*_-nBMM2(Js(1ah z_4Ke+%VSE~4>@G%X|jK>bH6pk$gFi~Wd(qUJtk(hGz+SWMTTZm0}Mu}t1!&D3|v~< zE@o4KkW|YmsMZM0^{rjAP!wrKR-!qXObwGPt%=6)hl$p=H_)+oVT)4;lh zrmb4qq9(Lp?apcloO~=E7FyCe)YXLHFvbEfQtF%?_kq6jM-9h9l>UZ|YSc7tD(Y3( z#{|H@%M~0mDTXY{sPo#Hh9ZfQt6-&JZ4tFnh%&u zL{(@~s-lVAMnS7bDS?kj^E5DO94ag1KDIt~rASO(01BEXy#Ekw|nQ(1$_LM?!QCJKnwDH9j#;J-i12 z!4Dxq2~+~1P^dp5kc}i?Bp1c%3$XHpe&$(ahEpMfA(f0+j9D_U!!B9Nwm`jKoBxRC z7dYo!>ww^MeZdD=hJT`~>SyW=M#6#^=A&*_990D_IH`~h={u{6xSbH_ofD$}pQ~XxNDy@at|yN4uiSwkjYR}t*X^|P@$orXj%e*paOxQp~(~* z?153NazY;1g^4IiNS2G+qprEwjHJCHw6PWJ73Z\% -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}