all.equal.haploNet: Compare Two Haplotype Networks

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/haplotype.R

Description

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

Usage

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

1
2
3
4
5
6
7
8
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

Example output

Loading required package: ape
Loading required package: adegenet
Loading required package: ade4

   /// adegenet 2.0.1 is loaded ////////////

   > overview: '?adegenet'
   > tutorials/doc/questions: 'adegenetWeb()' 
   > bug reports/feature requests: adegenetIssues()



Attaching package: 'pegas'

The following object is masked from 'package:ade4':

    amova

The following object is masked from 'package:ape':

    mst

 [1] "Number of links different"      "Links in target not in target:"
 [3] "No1007S--No1208S"               "No0913S--No304"                
 [5] "No1202S--No306"                 "No0906S--No1202S"              
 [7] "No0910S--No0913S"               "No0913S--No1202S"              
 [9] "No1007S--No1103S"               "No0906S--No306"                
[11] "No1103S--No304"                 "No0912S--No306"                
[13] "No0908S--No1103S"               "No0908S--No1206S"              
[15] "No0910S--No1103S"               "No0910S--No1206S"              
[17] "No1103S--No1202S"               "No1103S--No1208S"              
[19] "No1202S--No1206S"               "No0908S--No304"                
[21] "No0910S--No304"                 "No1202S--No304"                
[23] "No0906S--No0913S"               "No0906S--No1103S"              
[25] "No0906S--No1206S"               "No0908S--No0910S"              
[27] "No0908S--No1202S"               "No0909S--No0912S"              
[29] "No0912S--No1007S"               "No0913S--No1103S"              
[31] "No1103S--No1206S"               "No0906S--No304"                
[33] "No1206S--No304"                 "No0909S--No306"                
[35] "No1007S--No306"                 "No0906S--No0908S"              
[37] "No0908S--No0913S"               "No305--No306"                  
[39] "No0912S--No304"                 "No0908S--No0912S"              
[41] "No0910S--No0912S"               "No0912S--No1202S"              
[43] "No0912S--No1208S"               "No0913S--No1206S"              
[45] "No1007S--No1202S"               "No304--No305"                  
[47] "No0912S--No305"                 "No1208S--No306"                
[49] "No0906S--No0912S"               "No0912S--No0913S"              
[51] "No0912S--No1206S"               "No0909S--No304"                
[53] "No1007S--No304"                 "No1114S--No306"                
[55] "No0908S--No0909S"               "No0908S--No1007S"              
[57] "No0909S--No0910S"               "No0909S--No1202S"              
[59] "No0910S--No1007S"               "No1103S--No1114S"              
[61] "No1202S--No1208S"              
[1] FALSE

pegas documentation built on July 13, 2018, 1:02 a.m.