Reputation: 1068
I have time series data on 10 individuals, similar to what is created below. I am looking for a way to make a 3-D plot similar to this example:
Except I want each unique ID
to be where year is in the picture
set.seed(123)
ID <- rep(1:10, each = 500)
Time = rep(c(1:500),10)
Var <- rnorm(5000)
data <- data.frame(
ID = factor(ID),
Time = Time,
Variable = Var
)
Upvotes: 1
Views: 1305
Reputation: 226871
As a very quick, and ugly start, try
library(plot3D)
## rearrange data into matrix form
m <- matrix(
data$Variable,
nrow=length(unique(data$ID)))
hist3D(z = m)
This doesn't look at all like your example plot; on the other hand, your data don't look much like the data in this plot. Things I haven't played around with yet:
Upvotes: 2