r - percent does not work on area() function - formattable -


i try create table percent value using area() function. not work @ (i.e. percent value). know how fix it?

#library(magrittr) #library(dplyr) #library(formattable) #library(scales)  set.seed(123) df <- data.frame(id = 1:10,               = rnorm(10), b = rnorm(10), c = rnorm(10))  df <- df %>%      mutate(a = percent(a), b = percent(b), c = percent(c))  # show percentage value without using area function formattable(df, list(a = color_tile("transparent", "pink"),                      b = color_tile("transparent", "pink"),                      c = color_tile("transparent", "pink")))  # not show percentage value formattable(df, list(area(col = a:c) ~ color_tile("transparent", "pink")))  sessioninfo()  [1] formattable_0.2   dt_0.1            scales_0.4.0  [4] tidyr_0.4.1       rcharts_0.4.5     dplyr_0.4.3       [7] shiny_0.13.2      

so far, best results i've gotten have been using code:

formattable(df, list(area(col = a:c) ~ percent)) 

but don't know how change number of digits in number :(


Comments