fbreitwieser / hiervis

Hierarchical visualization for R/Shiny

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hiervis rounding numbers to nearest 5

GaryNapier opened this issue · comments

Hi,
I have the following code:

df <- data.frame(x = c(rep("yes", 526), rep("no", 209)), 
           y = c(rep("yes", 53), rep("no", 682)))

hiervis(table(df), 'sankey')

The numbers on the hiervis diagram seem to round up or down to the nearest 5.

The root for example is showing 740, when the total is 735.

However the only number that is displayed 'as-is' is 53 - i.e. the "x-yes, y-yes" of the table.

How can I get the hiervis to display the numbers exactly?

One of the arguments in vis.opts is numberFormat = ",d", but I don't know what this means and there is no documentation about it. I have tried changing ",d" to all sorts of other things including "", NA, NULL and various suggestions here, but nothing has worked.

Many thanks,
Gary

p.s. the HairEyeColor example seems mixed rounded and 'as-is' - e.g. the root is 590 but sum(HairEyeColor) = 592, yet root > Red is displayed as exactly 71.