Description Usage Arguments Details Value Examples
centroid
The desktop version of GARP records the instance of a presence location in a grid cell, and therefore does not distinguish between multiple locations within a single cell. This function
returns the centroid location of all grid cells that contain a presence location, which circumvents multiple locations. It is useful when input rasters cells are large or
when sampling was unevenly clustered. This function uses the cell size and extent of user-defined raster to generate centroid coordinates of all cells that contain presence locations.
1 |
x |
an object of class raster that represents the spatial resolution and extent of raster inputted into GARP |
points |
a data.frame or SpatialPointsDataFrame object containing latitude and longitude values of presence locations |
xy |
a vector object of latitude and longitude coordinates from |
species |
the vector of species names from the |
x
should be a raster that represents the spatial resolution and extent of all environmental layers that will be inputted into GARP. Recommended to use a raster output by rasterPrep
.
A SpatialPointsDataFrame object containing "Latitude", "Longitude", and "Species" vectors.
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))
centroid(x = r, points = hs, xy = cbind(hs$Latitude, hs$Longitude), species = hs$Species)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.