je n'arrive pas à relier un input dans un graph que je souhaite faire sur Rshiny, auriez-vous une idée ?
Code : Tout sélectionner
library(shiny)
library(ggplot2)
route_fond_degre <- c(1:10)
vitesse_fond_noeuds <- c(2:11)
heure <- c(01:05:30,01:05:31,01:05:32,01:05:33,01:05:34,01:05:35,01:05:36,01:05:37,01:05:38,01:05:39)
df_25mars_sample <- data.frame(heure, route_fond_degre, vitesse_fond_noeuds)
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel("Barre latérale",
selectInput(inputId = "variable",
label = "Sélectionner :",
choices = list("vitesse_fond_noeuds",
"route_fond_degre"),
selected = 1)
),
mainPanel(
plotOutput("graph1")
)
)
))
shinyServer(function(input, output) {
output$graph1 <- renderPlot({
g <- ggplot(df_25mars_sample, aes(x=heure, y = input$variable))+
geom_point()
g
})
})
Merci beaucoup !