Scientific notation or not

54 views
Skip to first unread message

charlott...@gmail.com

unread,
Mar 8, 2016, 6:16:40 AM3/8/16
to Shiny - Web Framework for R
Dear all,

I am using renderTable and tableOutput to print a table in my app. However, I would like to ask shiny to show figures in scientific notation (e.g. 3.38e-5) instead of 0.0000385.

I did not find the right parameter to set this. Do you know the way to do that ?

Thank you very much in advance,

Cheers !

Cha

Joe Cheng [RStudio]

unread,
Mar 8, 2016, 2:00:07 PM3/8/16
to Shiny - Web Framework for R
Add the argument digits=-3 to the renderTable call.

output$table <- renderTable({
  ... table expr ...
}, digits = -3)

xtable interprets negative numbers as scientific notation, the abs value indicates the number of digits to display.

charlott...@gmail.com

unread,
Mar 9, 2016, 6:47:35 AM3/9/16
to Shiny - Web Framework for R
It works perfectly !! Again (and again) thank you Joe !!

Have a good day !

Davit Sargsyan

unread,
Aug 26, 2016, 8:26:23 AM8/26/16
to Shiny - Web Framework for R
Thank you Joe, it works!
Reply all
Reply to author
Forward
0 new messages