Обычно я просто переименовываю свои столбцы как последний шаг в блестящем перед передачей кадра данных в выходной рендер:
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)