【发布时间】:2015-12-24 19:27:38
【问题描述】:
我正在读一本书,我发现了这段代码。我试过了,但我对我得到的图表有点困惑。
这是数据样本。
consumption[sample(1:nrow(consumption), 5, replace=F),]
Food Units Year Amount
8 Fruits and Vegetables Pounds 1980 603.57948
31 Caloric sweeteners Pounds 1995 144.08113
16 Fruits and Vegetables Pounds 1985 630.24491
28 Eggs Number 1995 232.28203
19 Fish and Shellfist Pounds 1990 14.94411
我得到了这张图。其中 Y 索引是从 1 到 20 的数字,不是正确的“数量”。
我该怎么做才能正确显示 Y 轴上的金额索引?
【问题讨论】:
-
我需要我的眼镜 :) 你能否在你的帖子中复制代码而不是使用图像。您还可以使用 dput() 将数据集包含在您的帖子中。