Remove unused code and minor bug in checks (is.ultrametric tree)
Reproducible example
1. Remove unused code
#calculate mean and sd for each parameter
#variation due to tree choice
mean_by_tree<-stats::aggregate(.~n.tree, data=sensi.estimates, mean) ### remove
statresults<-data.frame(min=apply(sensi.estimates,2,min),
max=apply(sensi.estimates,2,max),
mean=apply(sensi.estimates,2,mean),
sd_tree=apply(mean_by_tree,2,stats::sd))[-1,] ### fix
Solution
#calculate mean and sd for each parameter
#variation due to tree choice
statresults<-data.frame(min=apply(sensi.estimates,2,min),
max=apply(sensi.estimates,2,max),
mean=apply(sensi.estimates,2,mean),
sd_tree=apply(sensi.estimates,2,stats::sd))
2. Fix check
if ( (model == "trend") & (ape::is.ultrametric(phy)))
stop("Trend is unidentifiable for ultrametric trees., see ?phylolm for details")
else
Solution
if ( (model == "trend") & (ape::is.ultrametric(phy[[1]])))
function
tree_phylolm
;intra_phylm
andintra_phyglm
Problem
Remove unused code and minor bug in checks (is.ultrametric tree)
Reproducible example
1. Remove unused code
Solution
2. Fix check
Solution