I wonder how to display numbers with comma using qpvt and qhpvt functions from pivottabler R package.
library(pivottabler)
qpvt(bhmtrains, "TOC", "TrainCategory", "n()")
Express Passenger Ordinary Passenger Total
Arriva Trains Wales 3079 830 3909
CrossCountry 22865 63 22928
London Midland 14487 33792 48279
Virgin Trains 8594 8594
Total 49025 34685 83710
qhpvt(bhmtrains, "TOC", "TrainCategory", "n()")
As the functions are evaluated as expressions as mentioned in the
vignettewe can wrap those with
commafromformattable-output
There is also a
format/formatsargument on which we can either a single format or a list of formats (when multiple expressions are used) i.e. if we want to show the digits