Home > Mobile >  R Shiny - How to simplify simplify the code?
R Shiny - How to simplify simplify the code?

Time:01-22

I would like to know how I can simplify the following code?

  observeEvent(input$structure_explorer_refresh, {
    shinyjs::reset("structure_explorer_form")
  })
  observeEvent(input$property_refresh, {
    shinyjs::reset("property_form")
  })
  observeEvent(input$structure_activity_refresh, {
    shinyjs::reset("structure_activity_form")
  })  
  observeEvent(input$structure_target_refresh, {
    shinyjs::reset("structure_target_form")
  })    
  observeEvent(input$target_id_refresh, {
    shinyjs::reset("target_id_form")
  }) 
  observeEvent(input$target_activity_refresh, {
    shinyjs::reset("target_activity_form")
  })  
  observeEvent(input$drug_target_refresh, {
    shinyjs::reset("drug_target_form")
  })    
  observeEvent(input$drug_info_refresh, {
    shinyjs::reset("drug_info_form")
  })  
  observeEvent(input$assay_id_refresh, {
    shinyjs::reset("assay_id_form")
  })  

I have tried to apply this enter image description here

  • Related