Skip to contents

The goal of this package is to provide germplasm curators with easily referable spatial data sets to help prioritize field collection efforts.

Overview

It provides functionality for seven sampling schemes which various curators are interested in, many of which are likely to outperform others for certain species or areas. The package also creates species distribution models, but with the goal of germplasm sampling, rather than predicting ranges at fine resolutions, or making inference; if you are interested in this functionality R has several dozen other packages which are tailored for these purposes.

Description

This package helps germplasm curators communicate areas of interest to collection teams for them to collect new material for accession. It provides seven different sampling approaches for curators to choose from for each individual taxon they hope to process.

Installation

safeHavens is available only on github. It can be installed using remotes or devtools

install.packages('remotes') 
remotes::install_github('sagesteppe/safeHavens')

Once installed it can be attached for use like any other package from github or CRAN

library(safeHavens)

Usage

safeHavens has only seven user facing functions for generating the sampling schemes.

Available Sampling Schemes

The following table shows the eight sampling approaches available in safeHavens, with their computational complexity (Comp.) and environmental data complexity5 (Envi.): L = Low, M = Medium, H = High.

Function Description Comp. Envi.
PointBasedSample Creates points to make grids over area L L
EqualAreaSample Breaks area into similar size pieces L L
OpportunisticSample Using PBS with existing records L L
IBDBasedSample Breaks species range into clusters H L
IBRSurface Breaks species range into clusters H M
PolygonBasedSample Using existing ecoregions or STZs L H
EnvironmentalBasedSample Uses correlations from SDM to sample H H
KMedoidsBasedSample For rare species with known occurrences M M
PosteriorCluster Uses posteriors from an SDM to cluster H H

An overview of the functionality in the package is below.

%%{init: {'theme':'dark', 'themeVariables': {
    'primaryTextColor':'#ffffff',
    'lineColor':'#ffffff',
    'lineWidth':'24px',
    'fontSize':'30px',
    'fontFamily':'Arial'}}}%%
flowchart LR
A[/Species Occurrence Data/]
B[/Environmental Covariates/]
A --> D(PointBasedSample)
A --> E(EqualAreaSample)
A --> F(OpportunisticSample)
A --> G(IBDBasedSample)
A --> J[elasticSDM]
A --> K[bayesianSDM]
A --> L(KMedoidsBasedSample)
B -.-> L
B --> J
B --> K
D --> N[PrioritizeSample]
E --> N
F --> N
G --> N
B --> H[buildResistanceSurface]
H --> V[populationResistance]
V --> W[IBRSurface]
W -.-> M[PolygonBasedSample]
M --> N
J --> O{postProcessSDM}
K --> O
O --> P{RescaleRaster}
O --> S{RescaleRasterBayes}
P --> Q(EnvironmentalBasedSample)
Q --> R[PredictiveProvenance]
Q -.-> M
R -.-> M
S --> T[PosteriorCluster]
T --> U2[projectClustersBayes]
U2 -.-> M
T -.-> M
classDef geoColor fill:#d95f02,color:#FFFFFF
classDef polyColor fill:#66a61e,color:#FFFFFF
classDef envColor fill:#1b9e77,color:#FFFFFF
classDef dataColor fill:#a6761d,color:#FFFFFF
classDef decisionColor fill:#7570b3,color:#FFFFFF
classDef rareColor fill:#e6ab02,color:#FFFFFF
classDef ibrColor fill:#e7298a,color:#FFFFFF
class D,E,F,G geoColor
class M polyColor
class J,K,O,P,S,T,Q,R,U2 envColor
class A,B dataColor
class N decisionColor
class L rareColor
class H,V,W ibrColor

Acknowledgements

Edzer Pebesma, and Krzysztof Dyba for help with seamless installations on Ubuntu, and getting the pkgdown website running.