I'm trying to have a plot render based off of what the user selects for an input and having some trouble. I can get the Input options up fine and the output to render, but it shows all of the data instead of just what the user selects. I think I'm close, but something is a little off. Any guidance here would be awesome, self-taught if you can't tell!
TestDT = data.table(
Team = c("Oregon", "Villanova", "Utah"),
"eFG%" = c(".5", ".6", ".4"),
"TOV%" = c(".3", ".1", ".6"),
ORBRate = c(".7", ".5", ".6"),
FTRate = c(".5", ".6", ".4")
)
ggplot(TestDT, aes(x=Team, y=ORBRate)) + geom_point()
ui <- basicPage(
selectInput("Team", "Select Team",
c("Oregon", "Villanova", "Utah")),
plotOutput("teamPlot")
)
server <- function(input, output) {
output$teamPlot <- renderPlot({
ggplot(TestDT, aes(x=input$Team,y=ORBRate)) + geom_point()
})
}
shinyApp(ui,server)