我有一个这种格式的数据文件:
Weight Industry Type
251,787 Kellogg h
253,9601 Kellogg a
256,0758 Kellogg h
....
我读取数据并尝试使用以下命令绘制直方图:
ce <- read.table("file.txt", header = TRUE)
we = ce[,1]
in = ce[,2]
ty = ce[,3]
hist(we)
但我得到这个错误:
错误 en hist.default(we) : 'x' 必须是数字。
我需要做什么才能为我的三个变量绘制直方图?