Skip to content

Instantly share code, notes, and snippets.

@pvictor
Created July 15, 2013 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvictor/6000352 to your computer and use it in GitHub Desktop.
Save pvictor/6000352 to your computer and use it in GitHub Desktop.
testShiny
library(shiny)
shinyServer(function(input, output) {
sortie<-NULL
sortie <- reactive({
if (input$click1>0) {data.frame(rnorm(10), rexp(10))}
})
output$click.feeback1 <- renderText({
text <- "Appuyez sur les boutons :"})
output$table <- renderTable({
data.frame(sortie())
})
graph <- reactive({
if (input$click1>0 & input$click2>0){plot(sortie())
}
})
output$graphique <- renderPlot({graph()
})
})
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("Titre"),
sidebarPanel(
br(),
h5(textOutput("click.feeback1")),
actionButton("click1", "Executer"),
br(),
actionButton("click2", "Tracer")
)
,
mainPanel(
#tabsetPanel(
h4("Tableau"),
tabPanel("Base", tableOutput("table")),
h4("Graphique"),
plotOutput("graphique")
# )
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment