0

我有一张像这样的表:

dt <- data.frame(name = c("A","B","C"),
                 color = c("#D2B48C","#D3D3D3","#CD853F"))

如何在 column 显示每种背景颜色dt$color

4

1 回答 1

2

您可以尝试使用包的show_col功能scales

DF <- data.frame(name = c("A","B","C"),
             color = c("#D2B48C","#D3D3D3","#CD853F"))

library(scales)              
scales::show_col(DF$color)

在此处输入图像描述

于 2016-08-29T10:06:08.207 回答