bin_ml_rec | R Documentation |

Maximum likelihood reconstruction of ancestral character states

```
bin_ml_rec(tree_data, ...)
```

`tree_data` |
a list of two elements (phy and data) resulting from using the
function |

`...` |
other arguments from |

Reconstructions are done using the function `ace`

from the
`ape`

package. The argument method is set as "ML" and the type
of variable is "discrete".

A table with columns representing bins, rows representing first tip states and then reconstructed nodes.

```
# a simple tree
data("tree5", package = "nichevol")
# a matrix of niche charactes (1 = present, 0 = absent, ? = unknown)
dataTable <- cbind("241" = rep("1", length(tree5$tip.label)),
"242" = rep("1", length(tree5$tip.label)),
"243" = c("1", "1", "0", "0", "0"),
"244" = c("1", "1", "0", "0", "0"),
"245" = c("1", "?", "0", "0", "0"))
rownames(dataTable) <- tree5$tip.label
# list with two objects (tree and character table)
treeWdata <- geiger::treedata(tree5, dataTable)
# Maximum likelihood reconstruction
ml_rec <- bin_ml_rec(treeWdata)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.