Learn R Programming

sdmApp (version 0.0.2)

sdmApp_fold_Explorer: Explore the generated folds and visualize the placement of folds and distribution of species data over folds.

Description

Explore the generated folds and visualize the placement of folds and distribution of species data over folds.

Usage

sdmApp_fold_Explorer(blocks, rasterLayer, speciesData, num)

Arguments

blocks

A SpatialBlock object.

rasterLayer

A raster object as background map for visualization.

speciesData

A simple features (sf) or SpatialPoints object containing species data (response variable).

num

A number of fold to assign as data test set.

Value

A map showing folds and the species data, that can be used to explore folds.

Examples

Run this code
# NOT RUN {
# load blockCV package data
library(blockCV)
awt <- raster::brick(system.file("extdata", "awt.grd", package = "blockCV"))
#import presence-absence species data
PA <- read.csv(system.file("extdata", "PA.csv", package = "blockCV"))
#make a sf object from data.frame
pa_data <- sf::st_as_sf(PA, coords = c("x", "y"), crs = raster::crs(awt))
#spatial blocking by specified range and random assignment
sb <- spatialBlock(speciesData = pa_data,species = "Species",
rasterLayer = awt,theRange = 70000,k = 5,
selection = "random",iteration = 100)
sdmApp_fold_Explorer(sb,awt,pa_data,1)
# }

Run the code above in your browser using DataLab