The nLTT
package facilitates plotting one or more nLTT
plots, using nllt_plot
and nllt_lines
.
These functions, however, do not show the average nLTT plot.
The function nltts_plot
plots multiple nLTT plots and
shows the average nLTT. This helps in getting a quick visualization of
your data.
For working with the raw values, get_nltt_values
is
preferably used.
Create two easy trees:
<- "((A:1,B:1):2,C:3);"
newick1 <- "((A:2,B:2):1,C:3);"
newick2 <- ape::read.tree(text = newick1)
phylogeny1 <- ape::read.tree(text = newick2) phylogeny2
There are very similar. phylogeny1
has short tips:
::plot.phylo(phylogeny1)
ape::add.scale.bar() #nolint ape
This can be observed in the nLTT plot:
::nltt_plot(phylogeny1, ylim = c(0, 1)) nLTT
phylogeny2
has longer tips:
::plot.phylo(phylogeny2)
ape::add.scale.bar() #nolint ape
Also this can be observed in the nLTT plot:
::nltt_plot(phylogeny2, ylim = c(0, 1)) nLTT
The average nLTT plot should be somewhere in the middle.
The same, now shown as a plot:
::nltts_plot(c(phylogeny1, phylogeny2), dt = 0.20, plot_nltts = TRUE) nLTT
Create two easy trees:
<- "((A:1,B:1):1,(C:1,D:1):1);"
newick1 <- paste0("((((XD:1,ZD:1):1,CE:2):1,(FE:2,EE:2):1):4,((AE:1,BE:1):1,",
newick2 "(WD:1,YD:1):1):5);"
)<- ape::read.tree(text = newick1)
phylogeny1 <- ape::read.tree(text = newick2) phylogeny2
There are different. phylogeny1
is relatively simple,
with two branching events happening at the same time:
::plot.phylo(phylogeny1)
ape::add.scale.bar() #nolint ape
This can be observed in the nLTT plot:
::nltt_plot(phylogeny1, ylim = c(0, 1)) nLTT
phylogeny2
is more elaborate:
::plot.phylo(phylogeny2)
ape::add.scale.bar() #nolint ape
Also this can be observed in the nLTT plot:
::nltt_plot(phylogeny2, ylim = c(0, 1)) nLTT
The same, now shown as a plot:
::nltts_plot(
nLTTc(phylogeny1, phylogeny2),
dt = 0.20,
plot_nltts = TRUE
)