我从泰坦尼克号数据集中创建了structable,并为其使用了镶嵌函数。一切都很顺利,我也希望从马赛克剧情中标出每个盒子的数量,给予他们的阶级,生存和性别的泰坦尼克号。事实证明,我无法做到这一点。我知道我需要使用labels_cells来实现这个功能,但我无法使用它(并且我无法找到任何示例)并结合可分析代码和以下代码。镶嵌图和文本值
library("vcd")
struct <- structable(~ Class + Survived + Sex, data = Titanic)
mosaic(struct, data = Titanic, shade = TRUE, direction = "v")