checkData: Check that input points overlap with input rasters

Description Usage Arguments Details Value Examples

View source: R/checkData.R

Description

checkData Checks that the training or testing points overlap environmental layers used in GARP.

Usage

1

Arguments

points

a spatial object of the presence data used for training GARP, testing output models, or both training and testing points

grid

a raster object of any environmental layer that will be input into GARP

mask

optional; a spatial object of the study or sampling area

Details

The raster used for grid should either be cropped to study or sampling area, or mask should be used to specify area to crop raster.

Value

If any point falls outside raster, will return error to resample or recrop raster to allow overlay. If all points fall within raster, will return message that data is okay to use in GARP.

Examples

1
2
3
4
5
6
  set.seed(0)
  library(raster)
  r   <- raster(ncols = 100, nrows = 100)
  r[] <- rbinom(5, 10, 0.3)
  hs  <- data.frame("Latitude" = c(-89, 72, 63, 42, 54), "Longitude" = c(-12, 13, 24, 26, 87), "Species" = rep("Homo_sapiens", 5))
  checkData(points = SpatialPoints(hs[,1:2]), grid = r)

cghaase/GARPTools documentation built on Aug. 6, 2021, 6:38 a.m.