I haven't seen that kind of display from an existing R package (though it might exist). You could probably build it up yourself using the rgl
package, e.g. this code
library(rgl)
locations <- cbind(x = rep(1:6, 36), y = rep(rep(1:6, 6), each = 6),
z = rep(1:6, each = 36))
colors <- sample(c("white", "blue", "red"), 216,
rep=TRUE, prob=c(0.9, 0.1, 0.1))
for (i in 1:216)
shade3d(translate3d(cube3d(scaleMatrix(0.3, 0.3, 0.3), col = colors[i]),
x=locations[i,1], y = locations[i, 2], z = locations[i, 3]))
produces this figure
However, that would be a lot of work. If you wanted to display the data, but not necessarily in a fake 3D plot, the mosaicplot()
in the base graphics
package might be able to do what you want, depending on what your data is like. Including some sample data in your question (using dput(<your data>)
) would make it easier to answer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…