collapsibleTree
collapsibleTree copied to clipboard
[Feature Request] Could we use a different variable for attribute?
This is such a great package! Is this possible to define another method in attribute instead of "leafCount" in collapsibleTreeSummary? I need a mean function that for each node sums up the numeric values defined in attribute and divides them by the number of leaves.
So right now you can change the attribute to another column name, and get the sum of that other column like this:
collapsibleTreeSummary(
warpbreaks,
c("wool", "tension", "breaks"),
attribute = "breaks",
fillFun = colorspace::terrain_hcl,
maxPercent = 50
)
However, I haven't yet worked on adding additional aggregation functions other than just cumulative sum for the summary function, since I was having some trouble getting the node filling to work right. The regular collapsibleTree
function does support using any aggregation function, but it will not automatically add a color gradient to your nodes.
Is there a work around to using collapsibleTree and getting the color gradient. I'm using mean for my aggFun so I can't use collapsibleTreeSummary.