當執行下面R代碼裏面,收到錯誤,如: -ERROR IN GGPLOT IN的Rx變量是離散
代碼: -
ggplot(train,aes(x = Pclass,fill=factor(Survived)))+
geom_histogram(width = 0.5)+
xlab("Pclass")+
ylab("TotalCount")+
labs(fill="Survived")
錯誤: -
Error: StatBin requires a continuous x variable the x variable is discrete. Perhaps you want stat="count"?
可能是什麼可能的原因? 請幫忙。 感謝
你想繪製直方圖? – AK88
@ AK88:是...... –
你的數據是什麼樣的? – AK88