Claddis.ordination {dispRity} | R Documentation |
Imports data from Claddis
Description
Takes Claddis data and computes both the distance and the ordination matrix
Usage
Claddis.ordination(data, distance = "mord", ..., k, add = TRUE, arg.cmdscale)
Arguments
data |
Data from |
distance |
Distance type to be computed by |
... |
Any optional arguments to be passed to |
k |
The number of dimensions in the ordination. If left empty, the number of dimensions is set to number of rows - 1. |
add |
whether to use the Cailliez correction for negative eigen values ( |
arg.cmdscale |
Any optional arguments to be passed to |
Details
If data
is a file path, the function will use a modified version of read.nexus.data
(that handles polymorphic and ambiguous characters). The file content will then be converted into a read_nexus_matrix
type list treating all characters as unordered.
If the distance
is set to NULL
, data
will be only converted into a read_nexus_matrix
type list.
Author(s)
Thomas Guillerme
See Also
calculate_morphological_distances
, read_nexus_matrix
, build_cladistic_matrix
, cmdscale
, custom.subsets
, chrono.subsets
, boot.matrix
, dispRity
.
Examples
## Not run:
require(Claddis)
## Ordinating the distance matrix of Claddis example data
Claddis.ordination(Claddis::michaux_1989)
## Creating simple discrete morphological matrix (with polymorphisms)
cat(
"#NEXUS
BEGIN DATA;
DIMENSIONS NTAX=5 NCHAR=5;
FORMAT SYMBOLS= \" 0 1 2\" MISSING=? GAP=- ;
MATRIX
t1 {01}1010
t2 02120
t3 1210(01)
t4 01111
t5 00101
;
END;", file = "morpho_matrix.nex")
## Ordinating the matrix (using a distance matrix)
Claddis.ordination("morpho_matrix.nex")
## Only converting the nexus matrix into a Claddis format
Claddis_data <- Claddis.ordination("morpho_matrix.nex", distance = NULL)
file.remove("morpho_matrix.nex")
## End(Not run)