标签: r dataframe dt formattable
我的桌子看起来像这样:
dt <- data.frame(name = c("A","B","C"), color = c("#D2B48C","#D3D3D3","#CD853F"))
如何在dt$color列显示每种背景颜色?
dt$color
答案 0 :(得分:2)
您可以尝试使用show_col包
show_col
scales
DF <- data.frame(name = c("A","B","C"), color = c("#D2B48C","#D3D3D3","#CD853F")) library(scales) scales::show_col(DF$color)