Running examples in 'DiscML-Ex.R' failed
The error most likely occurred in:

> ### Name: DiscML-package
> ### Title: DiscML: An R package for estimating evolutionary rates of
> ###   discrete characters using maximum likelihood
> ### Aliases: DiscML-package DiscML print.DiscML read.tree2
> 
> ### ** Examples
> 
>   
> # The default arguments in DiscML are:
> # model = "ER"
> # reversible = FALSE
> # alpha = FALSE
> # rootprobability = FALSE
> 
> x<- c(1,2,1,0,1)
> phy <- rtree(length(x))
> 
> # x is a vector with 5 elements, and phy is a randomly generated
> # 5-taxon tree (using rtree from the 'ape' package).
> DiscML(x, phy)

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy)

Log Likelighood (type '...$loglik' to get this data):  -5.493061 

Rate index matrix:
  0 1 2
0 . 1 1
1 1 . 1
2 1 1 .

Standardized matrix values:
  rate.index value
          1   0.5

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate  std-err
    mu0 20.43544 34284.98

Prior root probability used (type '...$rprob' to get this table): 
 characters     value
          0 0.3333333
          1 0.3333333
          2 0.3333333

Total time elapsed in running this function (type '...$time' to get this data): 
0.31 seconds 
> 
> # x here is a matrix
> x <- matrix(c(1,2,0,2,1,0),2,3, byrow = TRUE)
> 
> # phy is a randomly generated tree containing 3 tips.
> phy <- rtree(3) 
> 
> # a symmetric rate transition matrix is used in the estimation.
> DiscML(x, phy, model = "SYM")

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, model = "SYM")

Log Likelighood (type '...$loglik' to get this data):  -6.591676 

Rate index matrix:
  0 1 2
0 . 1 2
1 1 . 3
2 2 3 .

Standardized matrix values:
  rate.index    value
          1 0.537590
          2 0.537589
          3 0.424821

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate  std-err
    mu0 6.363432 189.1871

Prior root probability used (type '...$rprob' to get this table): 
 characters     value
          0 0.3333333
          1 0.3333333
          2 0.3333333

Total time elapsed in running this function (type '...$time' to get this data): 
0.47 seconds 
> 
> # the prior root probabilities will be estimated.
> DiscML(x, phy, rootprobability = TRUE)

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, rootprobability = TRUE)

Log Likelighood (type '...$loglik' to get this data):  -5.236565 

Rate index matrix:
  0 1 2
0 . 1 1
1 1 . 1
2 1 1 .

Standardized matrix values:
  rate.index value
          1   0.5

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate std-err
    mu0 1.722675 0.91002

Prior root probability estimated (type '...$rprob' to get this table): 
 characters estimate  std-err
          0        1 0.848169
          1        0 0.871221
          2        0 0.280610

Total time elapsed in running this function (type '...$time' to get this data): 
0.34 seconds 
> 
> # the prior root probabilities are fixed to be 1/16, 5/16, and 10/16.
> DiscML(x, phy, rootprobability = c(1/16,5/16,10/16))

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, rootprobability = c(1/16, 5/16, 10/16))

Log Likelighood (type '...$loglik' to get this data):  -6.591674 

Rate index matrix:
  0 1 2
0 . 1 1
1 1 . 1
2 1 1 .

Standardized matrix values:
  rate.index value
          1   0.5

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate  std-err
    mu0 68.58673 115069.4

Prior root probability used (type '...$rprob' to get this table): 
 characters  value
          0 0.0625
          1 0.3125
          2 0.6250

Total time elapsed in running this function (type '...$time' to get this data): 
0.3 seconds 
> 
> # the alpha value in a gamma distribution will be estimated.
> DiscML(x, phy, alpha = TRUE)

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, alpha = TRUE)

Log Likelighood (type '...$loglik' to get this data):  -6.591674 

Rate index matrix:
  0 1 2
0 . 1 1
1 1 . 1
2 1 1 .

Standardized matrix values:
  rate.index value
          1   0.5

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate  std-err
    mu0  20.3226 4420.188

Prior root probability used (type '...$rprob' to get this table): 
 characters     value
          0 0.3333333
          1 0.3333333
          2 0.3333333

alpha parameter estimate for discrete-gamma estimate (type '...$alpha' to get this table):
        estimate  std-err
alpha:  4.094256 1387.752

Total time elapsed in running this function (type '...$time' to get this data): 
0.75 seconds 
> 
> # DiscML allows the reversibility for the symmetric matrices, e.g., ER, SYM..
> DiscML(x, phy, rootprobability = TRUE, reversible = TRUE)

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, reversible = TRUE, rootprobability = TRUE)

Log Likelighood (type '...$loglik' to get this data):  -6.591674 

Rate index matrix:
  0 1 2
0 . 3 5
1 1 . 6
2 2 4 .

Standardized matrix values:
  rate.index value
          1   0.5
          2   0.5
          3   0.5
          4   0.5
          5   0.5
          6   0.5

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate  std-err
    mu0 10.74814 18032.39

Prior root probability estimated (type '...$rprob' to get this table): 
 characters estimate  std-err
          0 0.333333 0.141108
          1 0.333333 0.201108
          2 0.333333 0.073795

Total time elapsed in running this function (type '...$time' to get this data): 
0.78 seconds 
> 
> # DiscML can convert all non-zero character states to be '1's to perform
> # binary analysis. 
> DiscML(x, phy, simplify = TRUE)

  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, simplify = TRUE)

Log Likelighood (type '...$loglik' to get this data):  -4.158883 

Rate index matrix:
  0 1
0 . 1
1 1 .

Standardized matrix values:
  rate.index value
          1     1

The values of mu's estimated (Type ...$mu to get this table):
 mu(ID) estimate  std-err
    mu0 8.197301 11229.11

Prior root probability used (type '...$rprob' to get this table): 
 characters value
          0   0.5
          1   0.5

Total time elapsed in running this function (type '...$time' to get this data): 
0.22 seconds 
> 
> # DiscML can compute for each gene family of 'x' individually,
> DiscML(x, phy, individualrates = TRUE)


  DiscML (Maximum Likelihood Method for Discrete Character States)

Call: DiscML(x = x, phy = phy, individualrates = TRUE)

Rate index matrix:
  0 1 2
0 . 1 1
1 1 . 1
2 1 1 .

Result summary (type '...$total' to get this data): 

Site  rate_index:1  Mu:mu0     std-err       Prior_Prob:0  1         2         Log Likelihood  
1     0.500000      10.664711  2.530370e+04  0.333333      0.333333  0.333333  -3.295837       
2     0.500000      10.660774  2.065276e+04  0.333333      0.333333  0.333333  -3.295837       

Total time elapsed in running this function (type '...$time' to get this data): 
0.52 seconds 
> 
> # this is equivalent to:
> # phy <- "(A$mu2:0.1,(B$mu0:0.3,C$mu1:0.4)$mu2:0.5);" 
> phy <- "(A$mu2:0.1,(B:0.3,C$mu1:0.4)$mu2:0.5);" 
> 
> # DiscML can optimize different mu's for each branches.
> DiscML(x, phy)
Error in match.fun(FUN) : object 'tree.build' not found
Calls: DiscML -> read.tree2 -> read.tree -> lapply -> match.fun
Execution halted