How to display rownames in dataTableOutput element?

1,165 views
Skip to first unread message

Qi Zhao

unread,
May 14, 2014, 11:04:04 AM5/14/14
to shiny-...@googlegroups.com

I prefer  using dataTableOutput to show my dataframe data, but i can't make the rownames visulized with dataTableOutput. I know the  tableOutput function can do this but it also  round my figures like 0.8812 to 0.88 ( which means only to significant figures were conserved) . can anyone give me some solutions?  
Thanks a lot

Yihui Xie

unread,
May 18, 2014, 1:56:16 AM5/18/14
to Qi Zhao, shiny-discuss
At the moment, you have to bind the row names as a column in the data, e.g.

renderDataTable(cbind(names = names(data), data))

instead of

renderDataTable(data)

Regards,
Yihui

Qi Zhao

unread,
May 18, 2014, 10:56:50 PM5/18/14
to shiny-...@googlegroups.com, Qi Zhao
Thanks! YiHui, this dose worked for me. I recently found that some one binded checkboxinputs before each row of table output with rendeUIr, which i will consider intergrate rownames with extra style infront of rows. Anyway,  thanks again for your kindly reply. :)

在 2014年5月18日星期日UTC+8下午1时56分16秒,Yihui Xie写道:
Reply all
Reply to author
Forward
0 new messages