-3
我必須對連續變量Weight
繪製具有值Y
和N
的分類變量flag
。哪種情節最好?如何用ggplot表示分類變量與連續變量?
qplot(x=Data$Weight, geom="histogram", main = "Weight distribution for Y Goods", binwidth = 0.5, xlab = "Weight of Y Goods", fill=I("blue"), col=I("red"), alpha=I(0.2), xlim=c(0,5))
家庭作業的問題不應該在這裏問。網上詳細介紹了大量的材料,適用於繪製分類變量和連續變量的圖表類型。你甚至試圖找出它? – Ashish
@ Ashish,首先我不是學生。 –
plot1 = qplot(X =數據$重量, 的geom = 「直方圖」, 主要= 「住宅商品重量分配」, binwidth = 0.5, xlab = 「住宅商品的重量」, 填充= I(」藍色「), col = I(」red「), alpha = I(0.2), xlim = c(0,5)) 但我無法將兩者結合。 –