【发布时间】:2012-09-19 13:56:57
【问题描述】:
我担心以下问题:我有一个 .csv 文件,其中包含我公司企业设计的 RGB 颜色。
cols <- read.table("cols.csv")
因为你没有文件,所以一些信息
str(cols)
返回
'data.frame':66 obs。 1 个变量: $ V1:因子 w/ 66 级 "0,0,0","0,122,155",..: 1 64 5 20 37 56 57 58 59 60 ... 和
cols
返回
V1
1 0,0,0
2 51,51,51
3 102,102,102
。 . .
我的想法是绘制一个矢量,并使用 R 中的 rgb 命令从我的文件中使用 66 个 rgb 颜色代码。 但是,如果我这样做:
x<-seq(0,2,0.2)
barplot(x, col=rgb(cols$V1[1],maxColorValue=255))
我明白了
Error in rgb(cols$V1[1], maxColorValue = 255) :
argument "green" is missing, with no default
我希望我能说清楚。
诚挚的问候,非常感谢您的帮助
【问题讨论】: