In developing an exercise recently, I discovered a small bug that was
introduced into the function
when I changed (in the latest phytools) version the optional argument
spread.labels to default from
TRUE. This bug causes the function to crash if labels are
turned off using
ftype="off" under the default conditions.
Here's how it manifests using simulated tree & data:
##  '0.4.56'
tree<-pbtree(n=26,tip.label=LETTERS) x<-fastBM(tree) phenogram(tree,x) ## works
phenogram(tree,x,ftype="off") ## doesn't work
## Error in optim(zz, ff, yy = yy, mo = mo, ms = ms, cost = cost, method = "L-BFGS-B", : L-BFGS-B needs finite values of 'fn'
phenogram(tree,x,ftype="off",spread.labels=FALSE) ## works
The fix is pretty easy - I just check if
spread.labels=FALSE if it is. I will put this in the
next version of phytools. Here's how it works:
phenogram(tree,x,ftype="off") ## now works
OK, that's it for now.