removeObs: Remove observations belonging to the shortest ("worst")...

View source: R/removeObservations.R

removeObsR Documentation

Remove observations belonging to the shortest ("worst") visits

Description

This function removes observations based on the visits effort or quality. Visit effort or quality could be given most often by species list length (that is, the number of species observed during the visit, SLL). However, in some cases there could be only one or few species observed but in great numbers each and spread across a big surveyed area. The effort then may not be small. If the user may find it necessary to remove those observations belonging to visits with an effort lower than a threshold, or a certain percentage of the "worst" observations, then this function will help.

Usage

removeObs(
  x,
  ev,
  criteria = "SLL",
  percent = 75,
  minCrit = NULL,
  stepChunk = 0.05
)

Arguments

x

an object of class ‘OrganizedBirds’ (organised BIRDS Spatial data.frame). See organizeBirds

ev

an object of class ‘data.frame’ from exploreVisits.

criteria

the criteria to rank "good visits". Accepts c("SLL", "nObs", "effortDiam", "medianDist")

percent

the percentage (i.e. 0 - 100) of observation to keep, or NULL. (default = 75)

minCrit

the minimum accepted of a given criteria in the data set (default = NULL).

stepChunk

if the search for observations includes too many in a given quality stage, the search takes progressively smaller fractions of the data set in steps. This argument controls for how small fractions are discarded on each step. If stepChunk = 0.05 (default) means that in the first step 95 the observations will be tested, then 95 adequate number of observations are obtained. Increase this argument if you see the function takes too long.

Details

Please note: this function removes all observations belonging to visits that fulfill the criteria. Also, the percentage of "lower quality" visits in the sample is not necessarily the same as the the percentage of "lower quality" observations. The removal of observations is done step wise by quantile therefore you may get a lower percentage than the aimed given than all remaining visits are too large to be included completely. This may happen particularly with smaller data sets.

Value

An updated OrganisedBirds dataset

Note

If both 'percent' and 'minCrit' are defined then 'percent' prevails.

Examples


OB <- organizeBirds(bombusObs, sppCol = "scientificName", simplifySppName = FALSE)
EV <- exploreVisits(OB)
OBshorter <- removeObs(OB, EV, percent = 75)


Greensway/BIRDS documentation built on Oct. 19, 2023, 2:35 a.m.