Plotting multiple datasets on a 3D plot
You can use the plot3Drgl library.  E.g.

library("plot3Drgl")
x &lt;- c(1,2,3,4,5)
y &lt;- c(6,7,8,9,10)
z &lt;- c(11,12,13,14,15)
colors &lt;- c(rep("red",3), rep("blue",2))
plot3d(x=x,y=y,z=z,col=colors)


Or you can use plotly:

library("plotly")
x &lt;- c(1,2,3,4,5)
y &lt;- c(6,7,8,9,10)
z &lt;- c(11,12,13,14,15)
colors &lt;- c(rep("red",3), rep("blue",2))
df&lt;-as.data.frame(cbind(x,y,z,colors))
colnames(df)&lt;-c("eat", "pork", "chops", "colors")

p &lt;- plot_ly(data=df, x=~eat, y=~pork, z=~chops, color =~colors, colors=c('#BF382A', '#0C4B8E')) %&gt;% ## Like a pipe?
  add_markers() %&gt;%
  layout(scene = list(xaxis = list(title = 'eat'),
                     yaxis = list(title = 'pork'),
                     zaxis = list(title = 'chops')))
htmlwidgets::saveWidget(as_widget(p), "index.html")


This saves the output as an html file.  In order to get this to work, you'll also need to install pandoc.  On CentOS/RedHat do yum install pandoc pandoc-citeproc.  On Mac OSX, using homebrew, do brew install pandoc.