我正在使用数据框DF(简单生成的示例):
Object *pointer = new Object();
使用Month <- c(1,2,3,5,8,9,6,3,2,2,12,12)
Brand <- c("Brand4","Brand5","Brand13","Brand62","Brand2","Brand1","Brand12","Brand12","Bra nd62","Brand55","Brand2","Brand1")
USD <- abs(rnorm(12))*100
DF <- data.frame(Month, Brand, USD)
绘制图形,如下所示:
qplot
在X轴我有几个月。但是,缺少4,8,10和11个月。 我想显示数据的季节性,因此X轴应该包括所有12个月。是否可以用数字1到12固定X轴,X轴还会显示空条的缺失月数?
是否可以使用qplot(as.factor(Month), USD, data=DF, fill=Brand,
stat="summary", fun.y="sum", geom="bar",
main = "Graph", xlab = "Month", ylab = "USD")
功能,还是应该使用其他功能?