【发布时间】:2015-01-21 20:56:31
【问题描述】:
如何在 Shiny 中定义数据表的数字格式?我想只为某些列显示 2 个十进制数字,但不明白它应该在我的应用程序中定义的位置。在server.R 或ui.R?在server.R 中,这是我在renderDataTable 中所拥有的:
output$woeTable <- renderDataTable({
input$tryTree
input$threshold
# The following returns data frame with numeric columns
get(input$dfDescr)[['variables']][[input$columns]][['woe']]
},
options=list(
paging = FALSE,
searching = FALSE)
)
如何格式化第 2 列和第 3 列以仅显示两位小数?
【问题讨论】:
-
在这里查看答案stackoverflow.com/a/31028061/2643104 using datatable() %>% formatRound()