Why isn't my data showing up on my shiny app line plot?

25 Views Asked by At

I'm trying to make a dynamic line plot in shiny where the user can pick a value from a drop down and then the corresponding weight values will be plotted.

This is the code I have so far - it makes the drop down and the graph just fine, it just doesn't fill in the values.

ui <- fluidPage(
  selectInput(inputId = "tag", 
              label = "Tag", 
              choices = unique(weights$Tag)),
  plotOutput("Line")
)

server <- function(input, output) {
  output$Line <- renderPlot({
    ggplot(weights %>% filter(Tag == input$tag), aes(x = date, y = weight)) +
      geom_line() 
    
  })
}

shinyApp(ui=ui, server = server)

Here's the empty graph. The dropdown is there, the scroll bar wouldn't let me see the whole thing at once.

enter image description here

0

There are 0 best solutions below