CalcRange: Range Polygons from Occurrence Points

View source: R/CalcRange.R

CalcRangeR Documentation

Range Polygons from Occurrence Points

Description

Calculate range polygons based on convex hulls from occurrence points. Includes planar and a ‘pseudospherical’ method for lat/long geographic coordinates and can crop to terrestrial area.

Usage

CalcRange(x, method = "pseudospherical", terrestrial = F, 
                      rare = "buffer", buffer.width = 10000)

Arguments

x

a data.frame of species occurrences, including the columns ‘species’, ‘decimallongitude’, ‘decimallatitude’ OR and object of the class spgeoOUT OR an object of the class SpatialPointsDataFrame, with at least one data column named ‘species’.

method

character string. The method to calculate convex hull. One of ‘euclidean’ and ‘pseudospherical’. See details.

terrestrial

logical. If TRUE the polygons are restriceted to terrestrial area as in landmass

rare

character string. Details how to deal with species with less <3 occurrence records. One of ‘buffer’ or ‘drop’. If buffer a geographic buffer with width buffer.width around the occurrence records is used, if “drop”, the respective species are dropped.

buffer.width

numeric. The size of the buffer for rare in meters. A cylindrical equal area projection is used for buffering. . Default is to 10000 meters.

Details

Be careful with polygons when using lat/long data, convex hulls on a sphere are not easily defined. The function is limited to occurrence records on one hemisphere, spanning less than 180 degrees longitude and not crossing the 180/0 boundary!

If method == 'euclidean', planar (projected, or local scale) coordinates are expected. If method == 'pseudospherical' the geosphere::makePoly is used to define the convex hull. In the latter case, to create the polygon intermediate points are added on a sphere between two coordinates.

Value

An object of the class SpatialPolygonsDataFrame.

Note

See https://github.com/azizka/speciesgeocodeR/wiki for more details and tutorials.

Examples

occ.exmpl<- data.frame(species = sample(letters, size = 250, replace = TRUE),
                       decimallongitude = runif(n = 250, min = 42, max = 51),
                       decimallatitude = runif(n = 250, min = -26, max = -11))

CalcRange(occ.exmpl, method = "pseudospherical", terrestrial = FALSE)

azizka/speciesgeocodeR documentation built on Sept. 5, 2023, 3:45 a.m.