# NOT RUN {
library(rgl)
data("slingshotExample")
rd <- slingshotExample$rd
cl <- slingshotExample$cl
rd <- cbind(rd, rnorm(nrow(rd)))
pto <- slingshot(rd, cl, start.clus = "1")
sds <- SlingshotDataSet(pto)
plot3d.SlingshotDataSet(sds, type = 'b')
# add to existing plot
plot3d(rd, col = 'grey50', aspect = 'iso')
plot3d.SlingshotDataSet(sds, lwd = 3, add = TRUE)
# }
Run the code above in your browser using DataLab