createAssignedSubspecies: Species Occurrences to Subspecies Occurrences

View source: R/createAssignedSubspecies.R

createAssignedSubspeciesR Documentation

Species Occurrences to Subspecies Occurrences

Description

This function is a wrapper for the package and takes a species with a list of subspecies, and then assigns points to subspecies. Points that have problems with assignment are listed as "suspect" and points without problems are listed as "good." Also returns polygons used to make subspecies assignments.

Usage

createAssignedSubspecies(
  spp,
  subsppList,
  pointLimit,
  dbToQuery,
  method = "raster",
  quant = 0.95,
  xmin = -180,
  xmax = 180,
  ymin = -90,
  ymax = 90,
  plotIt = F,
  bgLayer = NULL,
  outputDir,
  datafile = NULL,
  epsilon = 1e-06,
  spp_epsilon = epsilon,
  subspp_epsilon = epsilon,
  restrictNominate = F,
  cleanup_nominate = T,
  num_digits_latlong = 2,
  cells_per_bgLayer = 50,
  downloadOnly = FALSE,
  ...
)

Arguments

spp

Genus and species to query, as string

subsppList

Strings of subspecies to query

pointLimit

Maximum point limit to return for each database – see spocc::occ

dbToQuery

List of databases to search through – see spocc::occ

method

Whether to calculate overlaps with rasters or polygons

quant

quant for density, below which points are removed. E.g., if set to 0.95, removes 95 percent least dense squares.

xmin

Minimum longitude extent to clip rasters to

xmax

Maximum longitude extent to clip rasters to

ymin

Minimum latitute extent to clip rasters to

ymax

Maximum latitude extent to clip rasters to

plotIt

Whether to generate plots

bgLayer

A background layer for generating plots

outputDir

What directory to output to

datafile

if already ran and saved output from spocc:occ, put file here – default NULL

epsilon

Parameter for anomaly detection

spp_epsilon

Parameter for anomly detection specifically for species

subspp_epsilon

Parameter for anomaly detection specifically for subspecies

restrictNominate

Whether or not to restrict the nominate and remove extra points

cleanup_nominate

Whether or not to clean up the nominate

num_digits_latlong

The number of digits to round the coordinates to

cells_per_bgLayer

How many cells to include per background layer

downloadOnly

Whether to run as download occurrences only

Examples


Env = raster::stack(list.files(path = '~/wc2-5/',pattern = "\\.bil$",full.names = T))
ext = raster::extent(c(-125, -60, 10, 50))
Env = raster::crop(Env, ext)
bg = Env[[1]]
phainopeplaNitens = createAssignedSubspecies(spp = "Phainopepla nitens",#' subsppList=c("nitens", "lepida"),#' pointLimit=500,dbToQuery=c("gbif", "bison", "inat", "ebird", "ecoengine", "vertnet"),#' quant=0.95,xmin=-125,xmax=-60,ymin=10,ymax=50,plotIt=T,bgLayer=bg,#' outputDir="~/project/")
suspect_occurrences = phainopeplaNitens$loc_suspect,#' good_occurrences = phainopeplaNitens$loc_good,#' subspecies_polygons = phainopeplaNitens$pol

kaiyaprovost/subsppLabelR documentation built on Feb. 28, 2025, 8 p.m.