title: 5 dimensional plot in r
body: <p>I am trying to plot a 5 dimensional plot in R. I am currently using the <code>rgl</code> package to plot my data in 4 dimensions, using 3 variables as the x,y,z, coordinates, another variable as the color. I am wondering if I can add a fifth variable using this package, like for example the size or the shape of the points in the space. Here's an example of my data, and my current code:</p>
  
  <pre><code>set.seed(1)
  df &lt;- data.frame(replicate(4,sample(1:200,1000,rep=TRUE)))
  addme &lt;- data.frame(replicate(1,sample(0:1,1000,rep=TRUE)))
  df &lt;- cbind(df,addme)
  colnames(df) &lt;- c("var1","var2","var3","var4","var5")
  require(rgl)
  plot3d(df$var1, df$var2, df$var3, col=as.numeric(df$var4), size=0.5, type='s',xlab="var1",ylab="var2",zlab="var3")
  </code></pre>
  
  <p>I hope it is possible to do the 5th dimension.
  Many thanks,</p>