0

I already created the box with the options, but I don't know how to make the graph change according to the selected column. I need that the y-axis be output$SelectTiempo and the colour of the graphic be output$SelectProfesional.

If you have some other advice that you think can help me, I really appreciate it.

output$Selectproce<-renderUI({
  selectInput("Selectproce", "Seleccione Procedimiento",
              BDnuevo$procedureCodes.0.name, multiple = T, selected = TRUE) 
})

BD6.2<-reactive({
  BDnuevo %>%
    filter(procedureCodes.0.name %in% input$Selectproce)
})

output$SelectProfesional<-renderUI({
  selectInput("SelectProfesional", "Seleccione perfil", choices = c("Inversionistas"="FullnameI" ,
                                                                    "Deudores"="FullnameD",
                                                                    "Autores"="FullnameA")
  ) 
})

output$SelectTiempo <-renderUI({
  selectInput("SelectTiempo", "Seleccione indicador", 
              choices = c( "TiempoR" = "RoomList",                                                                 
                           "TiempoS"="SpacioTime")) 
})

Fechasd<-reactive({
  BD6.3<-BD6.2()
  unique(BD6.3$simpleOriginDate)
})

output$RandeDated<-renderUI({
  dateRangeInput('dateRange6',
                 label = 'Seleccione un rango',
                 start = min(Fechasd(),na.rm=T), max(Fechasd(),na.rm=T)
  )
})

BD6.4<-reactive({
  BD6.5<-BD6.2()
  BD6.5 %>%
    filter(simpleOriginDate >= input$dateRange6[1] & simpleOriginDate <= input$dateRange6[2])
})

output$lineplotTS <- renderPlot({
  BD6.5<-BD6.4()
  subset (BD6.5,BD6.5$times.simpleMinutesRecoverTime >=1 & BD6.5$times.simpleMinutesRecoverTime <= 1000)%>%
    ggplot(aes(x = simpleOriginDate, y= , colour = ?????????????))+
    geom_point()+
    scale_x_date(date_breaks = "1 month", date_labels =  "%b %Y")+
    theme(axis.text.x=element_text(angle=45, hjust=1))
})
})
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
ErikaC
  • 65
  • 6
  • Hi Erika. You could use e.g. `input$SelectProfessional`. However, as this is a character you have to make use of e.g. the .data pronoun, i.e. do `color = .data[[input$SelectProfessional]]`. Additionally to help us to help you, you should make your example reproducible. See [how to make a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – stefan Dec 21 '20 at 09:19
  • Thank you a lot, you really help me, I am sorry about my script, I am really new and I am trying to learnd. Thank you again – ErikaC Jan 08 '21 at 03:15

0 Answers0