convexHull: Convex hull

Description Usage Arguments Value Examples

View source: R/convexHull.R

Description

Creates a convex hull with a buffer using all the occurrence points available for a species. This convex hull is used as the basis to calculate the species range when a specialist range map is not available.

Usage

1
convexHull(occ_data, buffer = 0.5, realm = NULL)

Arguments

occ_data

output of function occData indicating the species occurrence

buffer

numeric, indicates the size of the buffer in km. Default is 0.5 degree.

realm

character, "terrestrial" or "marine". NULL will considere both.

Value

This function standardises the user provided georeferenced biological data to be fed into the models.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create a data.frame containing species names and coordinates

test_data <- data.frame(sps=rep("Equus acephalus",10),
             lon=c(-43.2,-58.4,-56,-44,-54.5,-57.4,-60.1,-68.5,-71.3,-47.5),
             lat=c(-22.9,-34.6,-34.8,-20,-25.5,-25.2,-3,-32.5,-41.1,-15.5),
             gender=rep("female",10),head_size=rep("headless individual"),
             occ=c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE,TRUE,TRUE))

occ_data <- occData(test_data,"sps","lon","lat","occ")

convex_hull <- convexHull(occ_data,realm = "terrestrial")

EduardoArle/speciesRanges documentation built on Feb. 2, 2022, 5:14 p.m.