I am using renderTable in Shiny to display a table. I am having trouble renaming the column names in the output.
server.R:
reactive.tables <- reactiveValues()
output$lump.sum <- renderTable(
if(input$my.password != am.password$password){
data.frame(`There is no` = "report")
} else {
print(1)
reactive.tables$occupancies %>% # sum amounts by company
group_by(company) %>%
summarise(lump.sum.2 = sum(lump.sum.2), n = n()) %>%
na.omit
},
colnames(output$lump.sum.2) = c("company", "lump sum", "occupancies")
)
Renaming columns seems to work fine outside of a reactive context. However, every time I specify the colnames argument within this reactive dataframe, I get the following error:
ERROR: Error sourcing C:\Users\Carlos\AppData\Local\Temp\RtmpmmVUym\fileb803ae92d13
Any suggestions would be greatly appreciated.
output$annual.sum
initially defined? Is it a misspelling ofoutput$lump.sum
? - Parfait