Re: [R-sig-phylo] Ordering barplot of traits to match tree

2011-06-29 Thread Roger Close
Hi Dave (I've Cc'd the list back in, in case someone else knows the answer), Thanks for the suggestions. You're right—the simulated data does plot in matching order (both for your example and Emmanuel's original one), so Emmanuel's code is not the problem. The difficulty is apparently in

Re: [R-sig-phylo] Ordering barplot of traits to match tree

2011-06-29 Thread Roger Close
Hi Enrico et al., Thanks for that hint; works very well! The traits are now plotted next to the correct order. I had to slightly modify it in order to reorder my data object, though: treeordered.data - data[my.tree$tip.label[my.tree$edge[my.tree$edge[, 2] = Ntip(my.tree), 2]],] On a related

Re: [R-sig-phylo] Ordering barplot of traits to match tree

2011-06-29 Thread Roger Close
Hello again, I tracked the strange ordering error down to the inclusion of c(NA, …) in the height argument of boxplot. Removing that correctly maps colours to factors, at the expense of dropping the entire boxplot down one unit. Thanks again, Roger --- Roger Close PhD Student School of

Re: [R-sig-phylo] Ordering barplot of traits to match tree

2011-06-29 Thread Matthew Helmus
Hi All, For another way, below is code that uses the ade4 library (phylog objects) to plot a barchart next to a phylogenetic tree. It is based on the dot.chart.phylog function... I am not sure how well it will work for your data, but it has worked well for most of what I have thrown at it.