library(shiny) library(tidyverse) hinnad=read_csv("https://minitorn.tlu.ee/~jaagup/kool/java/kursused/21/andmeanalyysi_lahendused_r_keeles/naited/0930/apple.csv") ui <- fluidPage( titlePanel("Apple aktsiad"), sliderInput("loppaeg", "kuni", min=as.Date("1980-01-01"), max=as.Date("2020-01-01"), value=c(as.Date("2003-01-01"), as.Date("2005-01-01"))), plotOutput("joonis1") ) #lisage algusaja slaider #Võimalusel pange y alati algama nullist server <- function(input, output) { output$joonis1 <- renderPlot({ print(input$loppaeg[[2]]) d1 <- hinnad %>% filter(Date > input$loppaeg[[1]], Date < input$loppaeg[[2]]) d1 %>% ggplot(aes(Date, Open))+geom_point()+ ylim(0, max(d1$Open)) }) } shinyApp(ui = ui, server = server)