我需要在我的马赛克情节上用不同颜色的颜色不粗鲁,有点粗鲁和非常粗鲁。我是怎么做到的
> table2p
rbabyF
hchildF Not rude Somewhat rude Very rude
No 65.225564 24.060150 10.714286
Yes 82.894737 13.157895 3.947368
> mosaicplot(table2p, main="Babies vs parents/nonparents", xlab = "Does the person have children?", ylab = "Is it rude to bring baby aboard")
答案 0 :(得分:0)
mosaicplot
有一个参数color
(请参阅documentation)。所以这应该有效:
mosaicplot(table2p,
main="Babies vs parents/nonparents",
xlab = "Does the person have children?",
ylab = "Is it rude to bring baby aboard",
color = c("blue", "red", "green"))