library(shiny) ui <- shinyUI(fluidPage( titlePanel("Funktsiooni uurimine"), sliderInput("kogus","Punktide arv:", min = 1, max = 200,value = 50), sliderInput("a","a:", min = -5, max = 10, value = 1, step=0.1), sliderInput("b","b:", min = -5, max = 10, value = 1, step=0.1), sliderInput("c","c:", min = -5, max = 10, value = 1, step=0.1), plotOutput("joonis"), plotOutput("joonis2") )) server <- shinyServer(function(input, output) { output$joonis2 <- renderPlot({ g=9.8 algkorgus=318 aeg=seq(0, 8, 0.1) koht=algkorgus-g*aeg*aeg/2 plot(aeg, koht) }) output$joonis <- renderPlot({ x=seq(-5, 5, length.out = input$kogus) #jaotiste arv y=input$a*x*x+input$b*x+input$c plot(x, y, type="l") #line abline(v=0) abline(h=0) }) }) shinyApp(ui = ui, server = server)