Skip to content

Commit

Permalink
Add acacia dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbouchet committed Jul 30, 2020
1 parent 70593ef commit f05ff99
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 19 deletions.
2 changes: 1 addition & 1 deletion R/compare_covariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 8 additions & 5 deletions R/compute_extrapolation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -81,20 +81,23 @@
#' library(sp)
#' library(magrittr)
#'
#' # Native and introduced range
#' data(acacia)
#'
#' # Download BioClim data
#' r <- raster::getData(name = "worldclim", var = "bio", res = 10)
#'
#' # Define variables of interest
#' 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
Expand Down
26 changes: 24 additions & 2 deletions R/dsmextra-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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

2 changes: 1 addition & 1 deletion R/extrapolation_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/globals.R
Original file line number Diff line number Diff line change
@@ -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"))
Binary file added data/acacia.rda
Binary file not shown.
25 changes: 25 additions & 0 deletions man/acacia.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/compare_covariates.Rd

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

13 changes: 8 additions & 5 deletions man/compute_extrapolation.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/extrapolation_analysis.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/spermwhales.Rd

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

0 comments on commit f05ff99

Please sign in to comment.