1

我在显示此表时遇到问题,其中数字用逗号分隔为千位分隔符(即,从 64482 到 64,482 等):

library(formattable)

df <- data.frame(id = 1:4,          
name = c("A","B","C","D"),         
usuarios = accounting(c(64482, 5077, 84428, 97869), format = "d"),         
sesiones = accounting(c(15892705, 1207458, 19521289, 25331543), format = 
"d"),          
ingresos = accounting(c(127033597, 11833290, 19979478, 268402434), format =  
"d"),      
transacciones = accounting(c(124798, 13944, 449494, 776689), format = "d"),      
stringsAsFactors = FALSE)      


align_column=c("l","l","r","r","r","r")    
formattable(df, align=align_column, list(      
area(col = c(A)) ~ normalize_bar("yellow", 0.1),      
area(col = c(B)) ~ normalize_bar("lightblue", 0.1),       
area(col = c(C)) ~ normalize_bar("silver", 0.1),       
area(col = c(D)) ~ normalize_bar("lightgreen", 0.1)))   

谢谢

4

0 回答 0