Learn R Programming

IsoplotR (version 0.14)

mds: Multidimensional Scaling

Description

Performs classical or nonmetric Multidimensional Scaling analysis

Usage

mds(x, ...)

# S3 method for default mds(x, classical = FALSE, plot = TRUE, shepard = FALSE, nnlines = FALSE, pch = 21, pos = NULL, cex.symbols = 2.5, col = "black", bg = "white", xlab = "", ylab = "", ...)

# S3 method for detritals mds(x, classical = FALSE, plot = TRUE, shepard = FALSE, nnlines = FALSE, pch = 21, pos = NULL, cex.symbols = 2.5, col = "black", bg = "white", xlab = "", ylab = "", ...)

Arguments

x

a dissimilarity matrix OR an object of class detrital

...

optional arguments to the generic plot function

classical

logical flag indicating whether classical (TRUE) or nonmetric (FALSE) MDS should be used

plot

show the MDS configuration (if shepard=FALSE) or Shepard plot (if shepard=TRUE) on a graphical device

shepard

logical flag indicating whether the graphical output should show the MDS configuration (shepard=FALSE) or a Shepard plot with the 'stress' value. This argument is only used if plot=TRUE.

nnlines

if TRUE, draws nearest neighbour lines

pch

plot character (see ?plot for details). May be a vector.

pos

a position specifier for the labels (if pch!=NA). Values of 1, 2, 3 and 4 indicate positions below, to the left of, above and to the right of the MDS coordinates, respectively.

cex.symbols

a numerical value giving the amount by which plotting symbols should be magnified relative to the default

col

plot colour (may be a vector)

bg

background colour (may be a vector)

xlab

a string with the label of the x axis

ylab

a string with the label of the y axis

Value

if plot=FALSE, returns an object of class MDS, i.e. a list containing the following items:

points

a two column vector of the fitted configuration

classical

a logical flag indicating whether the MDS configuration was obtained by classical (TRUE) or nonmetric (FALSE) MDS

diss

the dissimilarity matrix used for the MDS analysis

stress

(only if classical=TRUE) the final stress achieved (in percent)

References

Vermeesch, P., 2013. Multi-sample comparison of detrital age distributions. Chemical Geology, 341, pp.140-146.

Examples

Run this code
# NOT RUN {
data(examples)
# Parameters 'xaxt' and 'yaxt' control if the axis is plotted at all.
mds(examples$DZ,nnlines=TRUE,cex=5,xaxt='n',yaxt='n')
dev.new()
mds(examples$DZ,shepard=TRUE)
# }

Run the code above in your browser using DataLab