clean_coordinates: Clean coordinates

View source: R/clean_coordinates.R

clean_coordinatesR Documentation

Clean coordinates

Description

Clean coordinates

Usage

clean_coordinates(
  x,
  predictors = NULL,
  unique_id = "id",
  lon = "lon",
  lat = "lat",
  species_col = "scientificName",
  srs = NULL,
  spatial_res = NULL,
  tests = c("equal", "zeros", "duplicates", "same_pixel", "capitals", "centroids",
    "seas", "urban", "gbif", "institutions", "env"),
  capitals_rad = 10000,
  centroids_rad = 1000,
  centroids_detail = "both",
  inst_rad = 100,
  range_rad = 0,
  zeros_rad = 0.5,
  threshold_env = 0.5,
  predictors_env = NULL,
  country_ref = NULL,
  capitals_ref = NULL,
  centroids_ref = NULL,
  inst_ref = NULL,
  range_ref = NULL,
  seas_ref = NULL,
  seas_scale = 10,
  additions = NULL,
  urban_ref = NULL,
  verbose = TRUE,
  species_name = NULL,
  report = T,
  dir = getwd(),
  value = "all"
)

Arguments

x,

a dataframe of observation containing at least: decimal coordinates into two columns and one unique identifier column

predictors,

raster stack of predictors

unique_id,

column name containing a unique row identifier

lon,

column name containing projected longitude, MUST BE same projection as the predictors raster

lat,

column name containing projected latitude, MUST BE same projection as the predictors raster

species_col,

column name containing the species name

tests

a vector of character strings, indicating which tests to run. See details for all tests available. Default = c("capitals", "centroids", "equal", "gbif", "institutions", "duplicates", "urban", "seas", "zeros", "env"). See parameters of each test at https://github.com/ropensci/CoordinateCleaner/blob/master/R/clean_coordinates.R

species_name,

string. If export, a folder with the species name will be created in the "dir" directory

report

logical or character. If TRUE a report file is written to the directory dir, summarizing the cleaning results. Default = FALSE.

dir

character, directory to write the cleaning results.

value

a character string defining the output value (clean or flagged). See return.

Value

If value == 'clean', a dataframe with problematic observations removed: nrows<= nrows(x) if value == 'flagged', observations dataframe x with a column 'flagged' TRUE = clean coordinate, FALSE = potentially problematic (= at least one test failed).


ReseauBiodiversiteQuebec/sdm-pipeline documentation built on June 23, 2022, 9:10 p.m.