Learn R Programming

Momocs (version 1.1.6)

which_out: Identify outliers

Description

A simple wrapper around dnorm that helps identify outliers. In particular, it may be useful on Coe object (in this case a PCA is first calculated) and also on Ldk for detecting possible outliers on freshly digitized/imported datasets.

Usage

which_out(x, conf, nax, ...)

Arguments

x
object, either Coe or a numeric on which to search for outliers
conf
confidence for dnorm
nax
number of axes to retain (only for Coe), if <1 retain enough axes to retain this proportion of the variance
...
additional parameters to be passed to PCA (only for Coe)

Examples

Run this code
# on a numeric
x <- rnorm(10)
x[4] <- 99
which_out(x)

# on a Coe
bf <- bot %>% efourier(6)
bf$coe[c(1, 6), 1] <- 5
which_out(bf)

# on Ldk
w_no <- w_ok <- wings
w_no$coo[[2]][1, 1] <- 2
w_no$coo[[6]][2, 2] <- 2
which_out(w_ok, conf=1e-12) # with low conf, no outliers
which_out(w_no, conf=1e-12) # as expected

Run the code above in your browser using DataLab