Learn R Programming

CoordinateCleaner (version 1.0-7)

tc_range: Flag Fossils with Extreme Age Ranges

Description

Flags record with an unexpectedly large temporal range, based on a quantile outlier test.

Usage

tc_range(x, lon = "lng", lat = "lat", 
         min.age = "min_ma", max.age = "max_ma", taxon = "accepted_name", 
         method = "quantile", mltpl = 5,  size.thresh = 7, max.range = 500,
         uniq.loc = FALSE, value = "clean", verbose = TRUE)

Arguments

x

a data.frame. Containing geographical coordinates and species names.

lon

a character string. The column with the longitude coordinates. Default = “decimallongitude”.

lat

a character string. The column with the longitude coordinates. Default = “decimallatitude”.

min.age

a character string. The column with the minimum age. Default = “min_ma”.

max.age

a character string. The column with the maximum age. Default = “max_ma”.

taxon

a character string. The column with the taxon name. If “”, searches for outliers over the entire dataset, otherwise per specified taxon. Default = “accepted_name”.

method

a character string. Defining the method for outlier selection. See details. Either “quantile” “mad”, or “time”. Default = “quantile”.

mltpl

numeric. The multiplier of the interquartile range (method == 'quantile') or median absolute deviation (method == 'mad')to identify outliers. See details. Default = 3.

size.thresh

numeric. The minimum number of records needed for a dataset to be tested. Default = 10.

max.range

numeric. A absolute maximum time interval between min age and max age. Only relevant for method = “time”.

uniq.loc

logical. If TRUE only single records per location and time point (and taxon if taxon != "") are used for the outlier testing. Default = T.

value

a character string. Defining the output value. See value.

verbose

logical. If TRUE reports the name of the test and the number of records flagged.

Value

Depending on the ‘value’ argument, either a data.frame containing the records considered correct by the test (“clean”) or a logical vector, with TRUE = test passed and FALSE = test failed/potentially problematic (“flags”). Default = “clean”.

Examples

Run this code
# NOT RUN {
minages <- runif(n = 11, min = 0.1, max = 25)
x <- data.frame(species = c(letters[1:10], "z"),
                lng = c(runif(n = 9, min = 4, max = 16), 75, 7),
                lat = c(runif(n = 11, min = -5, max = 5)),
                min_ma = minages, 
                max_ma = minages + c(runif(n = 10, min = 0, max = 5), 25))

tc_range(x, value = "flags", taxon = "")
# }

Run the code above in your browser using DataLab