Learn R Programming

EMMAgeo (version 0.9.4)

robust.EM: Function to extract robust end-members.

Description

This function takes a matrix with end-member loadings and extracts those whose modes fall into specified limits. The function returns a list with all passing end-member loadings and scores, along with their respective coumn-wise (variable-wise) measures of centrality and dispersion.

Usage

robust.EM(Vqsn, limits, quantiles, Vqn, classunits, ID, plot = FALSE, legend,
  ..., pm = FALSE)

Arguments

Vqsn

Numeric matrix with m samples (rows) and n variables (columns).

limits

Numeric matrix with two columns that contain the boundaries of mode classes for each end-member. The first column contains the lower, the second column the upper limit. If classunits are provided, the limits are assumed to relate to these units, if omitted column-numbers of Vqsn are used.

quantiles

Optional numeric vector of length two with the quantiles to be evaluated for the robust end-member loadings; default is c(0.25, 0.75).

Vqn

Numeric matrix with optional normalised factor loadings. If present, the same factor loadings as the respectively selected end-member loadings are returned.

classunits

Numeric vector, optional class units (e.g. phi classes or micrometers) of the same length as columns of X.

ID

Numeric or character vector, optional sample IDs of the same length as columns of X.

plot

Logical scalar, optional graphical output of the results, default is FALSE. If set to TRUE, selected end-member loadings are plotted in different colours, according to the specified classes. All end-member loadings are plotted in pale colour, means and standard deviations are plotted above in thicker lines. To plot median and quantile range instead of mean and standard deviation, add median = TRUE as further plot parameter. See examples section for further advice.

legend

Character scalar, specifing legend position (cf. legend). If omitted, no legend will be plotted, default is no legend.

pm

Logical scalar to enable pm.

Additional arguments passed to the plot function. Use colour instead of col to create different colours.

Value

A list object containing:

Vqsn.data

A list with Vqsn values.

Vqsn.mean

A matrix with Vqsn means.

Vqsn.median

A matrix with Vqsn medians.

Vqsn.sd

A matrix with Vqsn standard deviations.

Vqsn.qt1

A matrix with Vqsn quantiles 1.

Vqsn.qt2

A matrix with Vqsn quantiles 2.

Vqn.data

A list with Vqn values.

Vqn.mean

A matrix with Vqn means.

Vqn.median

A matrix with Vqn medians.

Vqn.sd

A matrix with Vqn standard deviations.

Vqn.qt1

A matrix with Vqn quantiles 1.

Vqn.qt2

A matrix with Vqn quantiles 2.

References

Dietze E, Hartmann K, Diekmann B, IJmker J, Lehmkuhl F, Opitz S, Stauch G, Wuennemann B, Borchers A. 2012. An end-member algorithm for deciphering modern detrital processes from lake sediments of Lake Donggi Cona, NE Tibetan Plateau, China. Sedimentary Geology 243-244: 169-180.

See Also

EMMA, test.robustness, define.limits

Examples

Run this code
# NOT RUN {
## load example data, i.e. here TR
data(TR, envir = environment())

## define end-member limits
limits = cbind(c(11, 31, 60, 78),
               c(13, 33, 62, 80))

## extract robust end-members with limits matrix
rEM <- robust.EM(Vqsn = TR$Vqsn, limits = limits,
                 plot = TRUE,
                 legend = "topleft",
                 cex = 0.7,
                 colour = c("orange", "navyblue", "springgreen4", "red4"),
                 median = TRUE)
# }

Run the code above in your browser using DataLab