R: Compare Two Haplotype Networks

all.equal.haploNet {pegas} | R Documentation

## 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

`haploNet`, `mst`

### 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

[Package pegas version 0.13 Index]