Skip to contents

Median rule method

Usage

medianrule(data, var, output, x = 2.3, pc = FALSE, pcvar = NULL, boot = FALSE)

Arguments

data

Dataframe or vector where to check outliers.

var

Variable to be used for outlier detection if data is not a vector file.

output

Either clean: for clean data output without outliers; outliers: for outlier data frame or vectors.

x

A constant for flagging outliers.

pc

Whether principal component analysis will be computed. Default FALSE

pcvar

Principal component analysis to e used for outlier detection after PCA. Default PC1

boot

Whether bootstrapping will be computed. Default FALSE

Value

Either clean or outliers.

Examples


if (FALSE) { # \dontrun{

data("efidata")

gbd <- check_names(data = efidata, colsp='scientificName', pct=90, merge=TRUE)

danube <- system.file('extdata/danube.shp.zip', package='specleanr')

db <- sf::st_read(danube, quiet=TRUE)

wcd <- terra::rast(system.file('extdata/worldclim.tiff', package='specleanr'))

refdata <- pred_extract(data = gbd, raster= wcd ,
                          lat = 'decimalLatitude',
                          lon= 'decimalLongitude',
                          colsp = 'speciescheck',
                          bbox = db,
                          minpts = 10)

 medout <- medianrule(data = refdata[['Salmo trutta']], var = 'bio6', output='outlier')
} # }