# NOT RUN {
# This could be used in a dynamic R Markdown document. See
# demo("shinyDemo") and demo("simpleShinyRgl") for Shiny apps.
inputPanel(
sliderInput("n", label = "n", min = 10, max = 100, value = 10, step = 10)
)
renderRglwidget({
n <- input$n
try(rgl.close())
plot3d(rnorm(n), rnorm(n), rnorm(n))
rglwidget()
}, outputArgs = list(width = "auto", height = "300px"))
# }
Run the code above in your browser using DataLab