0

these are my shiny codes for bayesian regression coefficient datatable output. ıt was used to work on my old computer but now with new computer I m gettting this error says Datatables warning table id=Datatables Table 6 pillar_num not supported

ui <- mainPanel(
  
      DT::dataTableOutput("bayes_model_coefficient")
    )

  bayes_model_coefficient<-eventReactive(input$model_runModel_2,{
    if (input$model_runModel_2==0){
      return()
    }
    coefff <- brms::fixef(bayes_model_re())[,"Estimate"]
    bayes_coef<-data.frame(Variable=names(coefff),Coefficient=format(round(fixef(bayes_model_re())[,"Estimate"],digits=2),big.mark=",",scientific = FALSE),
               Est.Error=format(round(fixef(bayes_model_re())[,"Est.Error"],digits=2),big.mark=",",scientific = FALSE),
               t.value=format(round(fixef(bayes_model_re())[,"Estimate"]/fixef(bayes_model_re())[,"Est.Error"],digits = 2),big.mark=",",scientific = FALSE),
               Rhat=round(summary(bayes_model_re())$fixed$Rhat,digits = 4),
               row.names = NULL
               #l-95% CI=round(fixef(bayes_model)[,"Q2.5"],digits=2)
               #u-95% CI=round(fixef(bayes_model)[,"Q97.5"],digits=2),
               #row.names = NULL)
    )
    
    bayes_coef_copy <- bayes_coef # kopya oluşturuldu çünkü datatable a dönüşüm yaptığımızda indirme yaparken hata alıyordum.
    bayes_coef$actualSign <- ifelse(coefff < 0, 1, 2) # used to style the Coefficient column
    prior_inf<-values$fixCoef_2
    if(is.null(prior_inf)) {
       prior_inf <- data.frame(prior = NA, coef = NA)
     }
    #prior_inf<-prior_inf[,c("prior", "coef")] #ww
    prior_inf <- subset(prior_inf, select=c("prior", "coef"))
    bayes_coef<-merge(bayes_coef,prior_inf,by.x="Variable",by.y="coef",all.x=TRUE)
    #bayes_coef <- left_join(bayes_coef, prior_inf, by = c("Variable" = "coef"))
    names(bayes_coef)<-c("Variable",
                         "Coefficient",
                         "Est.Error",
                         "t.value",
                         "Rhat",
                         "actualSign",
                         "prior")
    
    bayes_coef<- bayes_coef[!is.na( bayes_coef$Variable),]
    # This is when the 'Run Model' button is clicked for the first time
  
    bayes_coef<-datatable(bayes_coef,
                          rownames=FALSE,
                          options=list(ordering=FALSE,
                                       paging=FALSE,
                                       info=FALSE,
                                       columnDefs = list(list(targets=c("actualSign"), visible=FALSE)))) %>% 
      formatStyle("t.value", color=styleInterval(-0.1, c("red", "black"))) %>% 
      formatStyle("Coefficient","actualSign", 
                  color=styleEqual(c(1,2),c("red","black")))
      
                          
    # kopya oluşturuldu çünkü datatable a dönüşüm yaptığımızda indirme yaparken hata alıyordum.  
    return(list(bayes_coef = bayes_coef, bayes_coef_copy = bayes_coef_copy))
    
  })

  #Get the coefficients out 
  #bayesian model output_2
   output$bayes_model_coefficient<-DT::renderDataTable({

     bayes_model_coefficient()$bayes_coef
   })

enter image description here

Anyone have any suggestions on how to solve this? Thanks a lot for help!

Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
Ozgur Alptekın
  • 505
  • 6
  • 19

0 Answers0