load shinytools JavaScript functions in a shiny application. Operation has to be made in the UI part.
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
library(shinytools)
if (interactive()) {
options(device.ask.default = FALSE)
# Define UI
ui <- fluidPage(
titlePanel("Hello dghiesse!"),
load_jstools(),
sidebarLayout(
sidebarPanel(
sliderInput( "obs",
"Number of observations:",
min = 0, max = 1000, value = 500)
),
mainPanel(plotOutput("distPlot"))
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
print(shinyApp(ui, server))
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.