This function reads a network from file using the Rich Newick format.

read.net(file = "", text = NULL, comment.char = "", ...)

Arguments

file

a file name specified by either a variable of mode character, or a double-quoted string; if file = "" (the default) then the tree is input on the keyboard, the entry being terminated with a blank line.

text

alternatively, the name of a variable of mode character which contains the tree(s) in parenthetic format. By default, this is ignored (set to NULL, meaning that the tree is read in a file); if text is not NULL, then the argument file is ignored.

comment.char

a single character, the remaining of the line after this character is ignored (this is passed directly to scan()).

...

further arguments to be passed to scan() and read.tree.

Value

A phylogenetic network of class evonet.

Details

If inheritance probabilities are included in the string, the returned evonet object will include an inheritance element. inheritance[i] corresponds to the inheritance probability of the hybrid edge denoted in reticulation[i,]

This function also accepts the optional arguments skip and tree.names. tree.names is used if there are several trees to be read and is a vector of mode character that gives names to the individual trees; if NULL (the default), the trees are named "tree1", "tree2", ... The optional argument skip denotes the number of lines of the input file to skip before beginning to read data (this is passed directly to scan()).

Examples

net<-read.net(text="((A:7,((B:2,C:2):3)#H1:2::0.6):3,(D:6,#H1:1::0.4):4);")