0
我想绘制使用ggplot2 boxplot。样本数据是这样的。ggplot2 boxplot
> sampe
count genotype
71 mt
50 mt
71 mt
95 wt
60 mt
63 mt
75 mt
82 wt
93 wt
87 wt
61 mt
102 wt
60 mt
78 wt
78 wt
87 wt
84 wt
104 wt
81 wt
85 mt
> qplot(factor(genotype),count,data=sampe,geom="boxplot")
上面的命令产生的情节是这样的:
什么是错在这里?为什么它这样阴谋?即使这下面的代码产生相同的输出。
ggplot(sampe,aes(x=factor(genotype),y=count))+geom_boxplot()
您的代码适用于我。你使用的是哪个版本:packageDescription(“ggplot2”)$ Version' - 最新版本是0.9.3.1 – csgillespie
它在这里运行得很好。什么给'class(sampe $ count)'?我猜这是一个“因素”? – juba
看来您的计数值在您的数据中存储为因子,这是我可以重现您的情节的唯一方法。 –