% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GRSex.R
\name{GRSex}
\alias{GRSex}
\title{Geographical representativeness score ex situ}
\usage{
GRSex(taxon, sdm, gBuffer)
}
\arguments{
\item{taxon}{A character object that defines the name of the species as listed in the occurrence dataset}

\item{sdm}{a terra rast object that represented the expected distribution of the species}

\item{gBuffer}{A terra vect which encompases a specific buffer distance around all G points}
}
\value{
A list object containing
1. results : a data frames of values summarizing the results of the function
2. gGaps : a terra vect object showing buffered area about g points
3. map : a leaflet object showing the spatial results of the function
}
\description{
The GRSex process provides a geographic measurement of the proportion of a species’ range
 that can be considered to be conserved in ex situ repositories. The GRSex uses buffers (default 50 km radius)
 created around each G coordinate point to estimate geographic areas already well collected within the distribution
 models of each taxon, and then calculates the proportion of the distribution model covered by these buffers.
}
\examples{
##Obtaining occurrences from example
data(CucurbitaData)
##Obtaining Raster_list
data(CucurbitaRasts)
##Obtaining protected areas raster
data(ProtectedAreas)
## ecoregion features
data(ecoregions)

# convert the dataset for function
taxon <- "Cucurbita_cordata"
sdm <- terra::unwrap(CucurbitaRasts)$cordata
occurrenceData <- CucurbitaData

# generate the g buffer object
gBuffer <- generateGBuffers(taxon = taxon,
                            occurrenceData = occurrenceData,
                            bufferDistM = 50000)

#Running GRSex
grs_exsitu <- GRSex(taxon = taxon,
                    sdm = sdm,
                    gBuffer = gBuffer
                    )



}
\references{
Khoury et al. (2019) Ecological Indicators 98:420-429. \doi{10.1016/j.ecolind.2018.11.016}
Carver et al. (2021) GapAnalysis: an R package to calculate conservation indicators using spatial information
}
