Learn R Programming

pegas (version 1.3)

all.equal.haploNet: Compare Two Haplotype Networks

Description

This function compares two haplotype networks and returns either TRUE or a description of the differences.

Usage

# S3 method for haploNet
all.equal(target, current, use.steps = TRUE, ...)

Value

either a logical value (TRUE), or a vector of mode character.

Arguments

target, current

two objects of class "haplotype".

use.steps

a logical value: whether to consider the number of steps (or length) in each link.

...

(unused).

Author

Emmanuel Paradis

Details

This function should return TRUE if the two networks are identical even if the links are ordered differently. In all other situations, a vector of character strings describing the differences is returned.

As usual with the all.equal function, this cannot be used directly to return a TRUE/FALSE value (see examples).

See Also

haploNet, mst

Examples

Run this code
data(woodmouse)
d <- dist.dna(woodmouse, "n")
nt1 <- mst(d)
nt2 <- msn(d)
(comp <- all.equal(nt1, nt2)) # clearly different

## how to use all.equal to return TRUE/FALSE:
isTRUE(comp) # FALSE

Run the code above in your browser using DataLab