[R] Select subtree with vector of leaves using zoom function of the ape package

Luigi Marongiu marongiu.luigi at gmail.com
Thu Jan 1 20:01:58 CET 2015

Dear all,
I am drawing a phylogenetic tree using the zoom() function of the ape package. Since I have 476 sequences in my alignment, this allows me to have the outlook of
the main tree and then highlight a portion of it, and this works fine.
At the moment I am using the approach of indicating the leaves (or tips) to highlight by indicating their sequential number, for instance the zoom is based on the
leaves 3:62.
In order to have more control on the tree I would like to use a vector with the names of the sequences to highlight, but when I feed it to the "focus" argument
I obtain the error:

Warning message:
In Ops.factor(focus[[i]]) : - not meaningful for factors

and the zoom is based on the whole tree rather than on the subtree.
The list of sequences is provided in the "leaf" vector in a column names "tip" and this approach does not work if I provide neither "leaf" nor "leaf$tip" as argument
for "focus".
Any tips?
Best regards

More information about the R-help mailing list