I'm using ggtree, which uses ggplot2, to plot a phylogeny.
I'm using R version 4.3.1, with ggplot version 3.4.2, and ggtree 3.8.2.
the script (executed from a temp file) that gives the issue is very simple:
library(ggtree)
tree <- read.tree('fa/clustal.DEG20010516.input.newick')
svg('fa/phylo.svg')
ggtree(tree) + theme_tree2() + geom_tiplab(align=TRUE, linesize=0.5) +xlim(0,0.6) + ggtitle('DEG')
dev.off()
but this returns an error:
! The tree contained negative edge length. If you want to ignore the edge, you
can set `options(ignore.negative.edge=TRUE)`, then re-run ggtree.
Error in ggtitle("DEG") : could not find function "ggtitle"
I'm getting instructions from https://4va.github.io/biodatasci/r-ggtree.html
how can I set the title when the standard way doesn't work?