mardi 27 juillet 2021

How to bring correct result from my data frame on R shiny?

I want to have properly working search button on my shiny app which bring data from my data frame (table1).here is my data frame;

table1 = data_frame = ( 
Ciliopathy = c("Acrocallosal Syndrome" ,"Alström Syndrome" , "Ataxia- 
telangiectasia-like Disorder" ,"Ataxia-telangiectasia-like Disorder" , 
"Autosomal Dominant Polycystic Kidney Disease (ADPK)" ,"Autosomal 
Dominant Polycystic Kidney Disease (ADPK)" , "Autosomal Dominant 
Polycystic Kidney Disease (ADPK)", "Autosomal Dominant Polycystic Kidney 
Disease (ADPK)","Autosomal Dominant Polycystic Kidney Disease (ADPK)"),

OMIM Phenotype Number = 
c(200990,203800,604391,615919,173900,613095,613095,600666,600666),

Human Gene Name = 
c("KIF7","ALMS1","MRE11","PCNA","PKD1","PKD2","PKD2","GANAB","GANAB"))

But when i search a spesific word it doesnt bring desired result. I think problematic part is here;

generow = reactive({

table1 %>% filter (Human.Gene.Name == "a" )

})  

output$tablom <- renderTable({ 

generow()

})

but still i can't figure out how to solve, here is my full code;

 ui <- fluidPage(
tags$h1("Search Input"),
br(),
searchInput(
  inputId = "a", label = "Enter your text",
  placeholder = "A placeholder",
  btnSearch = icon("search"),
  btnReset = icon("remove"),
  width = "450px"
),
br(),
(outputId = "tablom"), tableOutput("tablom")
)

server <- function(input, output, session) {

generow = reactive({

 table1 %>% filter (Human.Gene.Name == "a" )

  })  

output$tablom <- renderTable({ 
  
  generow()

  })
 }

shinyApp(ui = ui, server = server) 

I need your suggestions




Aucun commentaire:

Enregistrer un commentaire