I am displaying a table in Shiny and want to use renderDataTable but it is not displaying the row names which are important to me. renderTable displays the row names fine but does not look as nice.
I have:
output$tab<-renderDataTable({tabplot()})
and have tried:
output$tab<-renderDataTable({tabplot()}, include.rownames=TRUE)
with no luck.
Try this, it works for me, although I can't fully reproduce your dataset.
output$tab <- DT::renderDataTable({
datatable( tabplot(), rownames = TRUE )
})
I've forced the use of the DT package, and also enclosed the table creation in a "datatable" call, which includes the option to enable rownames. I think you'd also be able to enable that option in the creation of "tablplot()", but it should definitely work here either way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With