Like the others, the proposed options are best presented, but this should help you get started if you want something similar to what you had.
df <- read.csv(textConnection("Age,Income,Risk young,high,1 young,medium,1.2 young,low,1.36 adult,high,1 adult,medium,1.12 adult,low,1.23 old,high,1 old,medium,1.03 old,low,1.11 ")) df$Age <- ordered(df$Age, levels=c('young', 'adult', 'old')) df$Income <- ordered(df$Income, levels=c('low', 'medium', 'high')) library(rgl) plot3d(Risk ~ Age|Income, type='h', lwd=10, col=rainbow(3))
This will create flat rectangles. For example, to create nice lines, see demo(hist3d) .
source share