]> git.donarmstrong.com Git - ape.git/blob - man/evonet.Rd
various updates for ape 2.7-2 (fixed)
[ape.git] / man / evonet.Rd
1 \name{evonet}
2 \alias{evonet}
3 \alias{print.evonet}
4 \alias{plot.evonet}
5 \alias{as.phylo.evonet}
6 \alias{as.networx.evonet}
7 \alias{as.network.evonet}
8 \alias{as.igraph.evonet}
9 \title{Evolutionary Networks}
10 \description{
11   \code{evonet} builds a network from a tree of class
12   \code{"phylo"}. There are \code{print} and \code{plot} methods as well
13   as a few conversion functions.
14 }
15 \usage{
16 evonet(phy, from, to = NULL)
17 \method{print}{evonet}(x, ...)
18 \method{plot}{evonet}(x, col = "blue", lty = 1, lwd = 1, alpha = 0.5,
19               arrows = 0, arrow.type = "classical", ...)
20 \method{as.phylo}{evonet}(x, ...)
21 \method{as.networx}{evonet}(x, weight = NA, ...)
22 \method{as.network}{evonet}(x, directed = TRUE, ...)
23 \method{as.igraph}{evonet}(x, directed = TRUE, use.labels = TRUE, ...)
24 }
25 \arguments{
26   \item{phy, x}{an object of class \code{"phylo"} or \code{"evonet"}.}
27   \item{from}{a vector (or a matrix if \code{to = NULL}) giving the node
28     or tip numbers involved in the reticulations.}
29   \item{to}{a vector of the same length than \code{from}.}
30   \item{col, lty, lwd}{colors, line type and width of the reticulations
31     (recycled if necessary).}
32   \item{alpha}{a value between 0 and 1 specifying the transparency of
33     the reticulations.}
34   \item{arrows}{see \code{\link{fancyarrows}}.}
35   \item{arrow.type}{idem.}
36   \item{weight}{a numeric vector giving the weights for the
37     reticulations when converting to the class \code{"networx"}
38     (recycled or shortened if needed).}
39   \item{directed}{a logical: should the network be considered as
40     directed? \code{TRUE} by default.}
41   \item{use.labels}{a logical specifying whether to use the tip and node
42     labels when building the network of class \code{"igraph"}.}
43   \item{\dots}{arguments passed to other methods.}
44 }
45 \details{
46   \code{evonet} is a constructor function that checks the arguments.
47
48   The classes \code{"networx"}, \code{"network"}, and \code{"igraph"}
49   are defined in the packages \pkg{phangorn}, \pkg{network}, and
50   \pkg{igraph}, respectively.
51 }
52 \value{
53   an object of class \code{c("evonet", "phylo")} which is made of an
54   object of class \code{"\link{phylo}"} plus an element
55   \code{reticulation} coding additional edges among nodes and uses the
56   same coding rules than the \code{edge} matrix.
57
58   The conversion functions return an object of the appropriate class.
59 }
60 \author{Emmanuel Paradis}
61 \seealso{
62   \code{\link[phangorn]{as.networx}} in package \pkg{phangorn}
63 }
64 \examples{
65 tr <- rcoal(5)
66 (x <- evonet(tr, 6:7, 8:9))
67 plot(x)
68 }
69 \keyword{manip}
70 \keyword{hplot}