I need help with action button working only once. If you click on button it will shows you graph,table and some text. But if you want to change something on sidebar like a colour it will change and you dont have to press the button... (I need to have: If you want to change something colour,values..you need to always push the action button to confirm it it cant change without button)
Also, I need to show only the last N rows from table airquality which depends on numericID input. Can anyone help me?
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
observeEvent(input$gobutton, {
output$textik <- renderText({
vypis=c("Zobrazili ste tabuľku s", input$numericID, "riadkami a boxplot pre atribút Ozone ste nastavili na farbu ", input$radioID)
print(vypis)
})
output$table <- renderTable(airquality)
output$distPlot <- renderPlot({
x <- airquality[,input$selectID]
boxplot(x~airquality$Month, col = input$radioID, border = 'white', main=input$textID)
})
})
})
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
titlePanel("Dáta Airquality"),
# Sidebar with a slider input for number of bins
sidebarPanel(
numericInput("numericID","PoÄet riadkov tabuľky",value=6, min=1, max=100, step=5),
selectInput("selectID","Vyberte atribút",choices=c(colnames(airquality))),
radioButtons("radioID","Vyberte farbu grafu", choices=c("yellow","green")),
textInput("textID","Zadajte nadpis grafu", value ="Nadpis"),
actionButton("gobutton","Start")
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot"),
tableOutput("table"),
textOutput("textik")
)
))