datatable - r shiny data table sometimes does not display -
i encountered weird situation made me confused , searched while seems no same issues mine data table package.
i used basic default data table in shiny app, see example:
server.r
library(shiny) library(dt) shinyserver(function(input, output) { output$expense_table_check<-renderdatatable({ iris }) })
ui.r
library(shiny) shinyui(fluidpage( mainpanel( navlistpanel( tabpanel("dt",h1("dt"), datatableoutput("expense_table_check")) ) ) ) )
sometimes above works fine not. tried replacing datatableoutput("expense_table_check")
datatableoutput('expense_table_check')
, works sometimes, sometime not.
i tried replacing output name expense_table_check
expense_table_check2
. still cannot solve issue. suggestion or comment appreciated.
i solved issues after revising code following , works time; add dt::
in front of datatable:
server.r
library(shiny) library(dt) shinyserver(function(input, output) { output$expense_table_check <- dt::renderdatatable({ iris }) })
ui.r
library(shiny) shinyui(fluidpage( mainpanel( navlistpanel( tabpanel("dt",h1("dt"), dt::datatableoutput("expense_table_check")) ) ) ) )
Comments
Post a Comment