-1

我正在使用 Rattle 附带的 weather.csv 数据集(注意:我没有为此使用 Rattle)并尝试构建一个与风向和风速相关的箱线图。我正在执行以下操作,但没有显示任何情节,也没有错误或警告:

weatherPlot <- ggplot(weather, aes(factor(WindGustDir), WindGustSpeed)) 
weatherPlot + geom_boxplot()

任何想法为什么我的情节会是空白的?

PS WindGustDir 数据是分类值,如 N、E、W、S、NW、SE 等,WindGustSpeed 是数值。

4

1 回答 1

2

您的代码适用于我的安装(R 2.15.2,64 位)。所以这可能不是编码问题。你能检查一下这个段周围没有任何其他导致问题的代码吗(例如,试试下面的极简代码。)

library(rattle)
library(ggplot2)

weatherPlot <- ggplot(weather, aes(factor(WindGustDir), WindGustSpeed)) 
weatherPlot + geom_boxplot()

在此处输入图像描述

于 2013-01-16T20:51:58.327 回答