There is an extension for "datatables" in R called "Responsive". It adds the "green plus" button on the left side of the row. By clicking on it we can get the view with "hidden" columns.
Here is an example. The "visible" column "mpg_percents_visible" has correct format (3%) when "hidden" column "mpg_percents_hidden" has incorrect formatting in extended view (0.0326644890340644).
library(DT) # 1. Data set df_mtcars <- mtcars %>% mutate( mpg_percents_visible = mpg / sum(mpg), mpg_percents_hidden = mpg / sum(mpg)) %>% select(mpg_percents_visible, everything()) # 2. Datatable datatable(df_mtcars, extensions = c('Responsive')) %>% formatPercentage(c('mpg_percents_visible', 'mpg_percents_hidden'))
How to show hidden column "mpg_percents_hidden" in a correct format (3%)?