我的所有列包含参数名称,如:"all_application","all_phones“,"all_send_forms”它在闪亮的表格中看起来不太好。你是怎么处理它的?我想把它改成更多带空格的人名。
发布于 2020-04-10 22:01:59
在将数据帧传递给输出渲染之前,我通常只是将列重命名为shiny中的最后一步:
library(tidyverse)
df <- tibble (all_columns = 1:3,
all_phones = c("a", "b", "c"))
df_nice_names <- df %>%
rename("All Columns" = all_columns,
"All Phones" = all_phones)
# A tibble: 3 x 2
`All Columns` `All Phones`
<int> <chr>
1 1 a
2 2 b
3 3 c 闪亮的应用程序:
library(shiny)
ui <- fluidPage(
titlePanel(""),
sidebarLayout(
sidebarPanel(
),
mainPanel(
tableOutput("table")
)
)
)
server <- function(input, output) {
output$table <- renderTable({
library(tidyverse)
df <- tibble (all_columns = 1:3,
all_phones = c("a", "b", "c"))
df_nice_names <- df %>%
rename("All Columns" = all_columns,
"All Phones" = all_phones)
})
}
# Run the application
shinyApp(ui = ui, server = server)https://stackoverflow.com/questions/61137921
复制相似问题