Я пытаюсь изменить заголовки столбцов блестящей таблицы данных.Это то, что я сделал до сих пор.Я добавил комментарии к коду в разделе сервера.Я пытаюсь изменить имена столбцов и ограничить выбор строк одним.
addr <- as.data.table(read.csv("addresses.csv", header = T, stringsAsFactors = F)
ui <- fluidPage(
br(),
fluidRow(
column(12, div(DT::dataTableOutput("addressTable"), style="font-family:verdana", align="left"))
),
fluidRow(
column(4, div(textOutput("selectedAddress"), align="center"))
)
)
server <- function(input, output) {
# output$addressTable <- DT::renderDataTable({
# names(addr) [1:4]<- c("STREET ADDRESS","CITY NAME","PROVINCE","POSTAL CODE")
# addr
# }) -- This code works, I was able to change the column headers but not able to add the selection single option.
output$addressTable <- DT::renderDataTable(addr, selection = 'single') - this code works with the selection to single, but not able to change column headers.
}
shinyApp(ui, server)