do_CMDS: Perform classical multidimensional scaling

View source: R/do_CMDS.R

do_CMDSR Documentation

Perform classical multidimensional scaling

Description

Perform classical multidimensional scaling (CMDS) on a distance matrix and plot the result. CMDS computes a set of points such that the distances between them approximate those of the distance matrix. The maximum number of dimensions of the points is set to three. The fraction of variance explained by the model is calculated and printed as the R-squared value.

Usage

do_CMDS(dm, write = FALSE, fp = "output/CMDS/", fn = "output")

Arguments

dm

A distance matrix.

write

logical flag: (default = FALSE) if TRUE then a plot will be written to file fn.

fp

a character string naming the file path to write to.

fn

a character string specifying the file name prefix (".gif" will be appended).

Value

A list of coordinates, eigenvalues, and other parameters as described in stats::cmdscale().


tjfinney/ANTTV documentation built on July 1, 2024, 11 p.m.