Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 class 'haploNet'
all.equal(target, current, use.steps = TRUE, ...)

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).

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).

Value

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

Author(s)

Emmanuel Paradis

See Also

Examples

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

pegas

Population and Evolutionary Genetics Analysis System

v1.0
GPL (>= 2)
Authors
Emmanuel Paradis [aut, cre, cph] (<https://orcid.org/0000-0003-3092-2199>), Thibaut Jombart [aut, cph] (<https://orcid.org/0000-0003-2226-8692>), Zhian N. Kamvar [aut, cph] (<https://orcid.org/0000-0003-1458-7108>), Brian Knaus [aut, cph] (<https://orcid.org/0000-0003-1665-4343>), Klaus Schliep [aut, cph] (<https://orcid.org/0000-0003-2941-0161>), Alastair Potts [aut, cph] (<https://orcid.org/0000-0003-0919-7279>), David Winter [aut, cph] (<https://orcid.org/0000-0002-6165-0029>)
Initial release
2021-04-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.