grid_matching: Compute nearest distance

View source: R/grid_matching.R

grid_matchingR Documentation

Compute nearest distance

Description

This function calculate nearest distance between a set of occurrences and a set of grid systems.

Usage

grid_matching(
  input_occ,
  input_grid = NULL,
  country = NULL,
  grid_metadata = NULL,
  flag_relativeTHD = NULL,
  flag_rm_Large_outlier = FALSE,
  flag_absoluteTHD = NULL
)

Arguments

input_occ

Input occurrences (shapefile or .txt/.csv data with decimalLongitude & decimalLatitude).

input_grid

A list of spatial polygons, each represent one grid system.

country

Character vector. A string or a vector of strings of countries names; can be used to subset known grid systems (G sheet, or a dataframe from user, in which case it should have a similar structure as G sheet).

grid_metadata

A dataframe, if null, G sheet is loaded; otherwise, user should provide a table that looks like G sheet.

flag_relativeTHD

Numerical. 0.1 if a relative distance is >0.1 or 10% of max distance (half of the diagonal line), then make it NA (meaning not from a grid).

flag_rm_Large_outlier

Give a pool of distances, then remove outliers (based on R boxplot algorithm).

flag_absoluteTHD

Numerical. An absolute distance, beyond of which an occurrence is excluded.

gridID

Character vector. A string or a vector of strings; grid ID to be used in the calculation (gridID from G sheet or user provied dataframe).

Author(s)

Xiao Feng


BiogeographyLab/gridder documentation built on April 21, 2024, 2:32 a.m.