Species Distribution Modelling Predictor Datasets

Terrestrial and marine predictors for species distribution modelling from multiple sources, including WorldClim < https://www.worldclim.org/>,, ENVIREM < https://envirem.github.io/>, Bio-ORACLE < https://bio-oracle.org/> and MARSPEC < http://www.marspec.org/>.

MIT License Build Status Coverage Status CRAN_Status_Badge

An R package to improve the usability of datasets with predictors for species distribution modelling (SDM).


    # or for the latest dev version

Example 1: Create SDM for Dictyota diemensis in Australia Note that this requires the ZOON, ggplot2, cowplot and marinespeed packages to be installed.

    # Inspect the available datasets and layers
    datasets <- list_datasets(terrestrial = FALSE, marine = TRUE)
    layers <- list_layers(datasets)
    # Load equal area rasters and crop with the extent of the Baltic Sea
    layercodes <- c("MS_biogeo05_dist_shore_5m", "MS_bathy_5m", 
                    "BO_sstrange", "BO_sstmean", "BO_salinity")
    env <- load_layers(layercodes, equalarea = TRUE)
    australia <- raster::crop(env, extent(106e5,154e5, -52e5, -13e5))
    # Compare statistics between the original and the Australian bathymetry
               calculate_statistics("Bathymetry Australia", 
                                    raster(australia, layer = 2))))
    # Compare correlations between predictors, globally and for Australia
    prettynames <- list(BO_salinity="Salinity", BO_sstmean="SST (mean)", 
                        BO_sstrange="SST (range)", MS_bathy_5m="Bathymetry",
                        MS_biogeo05_dist_shore_5m = "Shore distance")
    p1 <- plot_corr(layers_correlation(layercodes), prettynames)
    australian_correlations <- pearson_correlation_matrix(australia)
    p2 <- plot_correlation(australian_correlations, prettynames)
    cowplot::plot_grid(p1, p2, labels=c("A", "B"), ncol = 2, nrow = 1)
    # Fetch occurrences and prepare for ZOON
    occ <- marinespeed::get_occurrences("Dictyota diemensis")
    points <- SpatialPoints(occ[,c("longitude", "latitude")],
    points <- spTransform(points, equalareaproj)
    occfile <- tempfile(fileext = ".csv")
    write.csv(cbind(coordinates(points), value=1), occfile)
    # Create SDM with ZOON
      occurrence = LocalOccurrenceData(
        occfile, occurrenceType="presence",
        columns = c("longitude", "latitude", "value")), 
      covariate = LocalRaster(stack(australia)),
      process = OneHundredBackground(seed = 42),
      model = LogisticRegression,
      output = PrintMap)
    # Layer citations

Example 2: view marine datasets, layers and load a few of them by name

    # exploring the marine datasets
    datasets <- list_datasets(terrestrial = FALSE, marine = TRUE)
    # exploring the layers
    layers <- list_layers(datasets)
    # download specific layers to the current directory
    rasters <- load_layers(c("BO_calcite", "BO_chlomean", "MS_bathy_5m"), datadir = ".")

Example 3: looking up statistics and correlations for marine annual layers:

    datasets <- list_datasets(terrestrial = FALSE, marine = TRUE)
    layers <- list_layers(datasets)
    # filter out monthly layers
    layers <- layers[is.na(layers$month),]
    stats <- layer_stats(layers)
    correlations <- layers_correlation(layers)
    # create groups of layers where no layers in one group 
    # have a correlation > 0.7 with a layer from another group
    groups <- correlation_groups(correlations, max_correlation=0.7)
    # inspect groups
    # heatmap plot for larger groups (if gplots library is installed)
    for(group in groups) {
      group_correlation <- as.matrix(correlations[group, group, drop=FALSE])
      if(require(gplots) && length(group) > 4){
                 ,main = "Correlation"
                 ,col = "rainbow"      
                 ,notecol="black"      # change font color of cell labels to black
                 ,density.info="none"  # turns off density plot inside color legend
                 ,trace="none"         # turns off trace lines inside the heat map
                 ,margins = c(12,9)    # widens margins around plot
      } else {

See the quickstart vignette for more information

    vignette("quickstart", package = "sdmpredictors")


sdmpredictors 0.2.8

Decrease test duration

sdmpredictors 0.2.7

Add freshwater data

sdmpredictors 0.2.6

Introduce dataset versions, fix citations

sdmpredictors 0.2.5

Fix authors

sdmpredictors 0.2.4

New datasets (ENVIREM, WorldClim paleo and future) Added functions related to correlations

sdmpredictors 0.2.3

Remove usage of ~/R/sdmpredictors from tests

sdmpredictors 0.2.2

Fix url in description

sdmpredictors 0.2.1

Fix urls in description and readme

sdmpredictors 0.2

Datadir is mandatory now, instead of automatically writing to ~/R/sdmpredictors.

sdmpredictors 0.1

Initial release of the sdmpredictors package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.11 by Salvador Fernandez, 2 months ago


Report a bug at https://github.com/lifewatch/sdmpredictors/issues

Browse source code at https://github.com/cran/sdmpredictors

Authors: Samuel Bosch [aut] , Lennert Tyberghein [ctb] , Olivier De Clerck [ctb] , Salvador Fernandez [aut, cre] , Lennert Schepers [ctb]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports R.utils, stats, utils, raster, rgdal

Suggests ggplot2, reshape2, testthat, knitr, rmarkdown

See at CRAN