Big mark and decimal mark

rmarkdown
shiny
rstudio

#1

Hello!

I'm writing several reports in pdf and html with R Markdown. Now I have to print tables and text with big number ie. 100000000, and I'm looking for a solution to print all these numbers with the format : 100.000.000 and make them more readable. I've found a solution, I can number by number change the output format with format and setting big.mark=".".

Is there any way to put this option global for the whole document?

Thanks!!


#2

Write a function that wraps around whatever you're using to create the tables.

library(dplyr)

report_table <- function(dataset, ...) {
  dataset %>%
    mutate_if(is.numeric, format, big.mark = ".") %>%
    make_table(...) # Or whatever function you've been using, like kable
}