I have an app that renders a table which is formatted using kable and kableextra. I've included a download function on the app and although the in-app view is working, the document for download does not produce the table at all.
I used the following code to make the table reactive on the server
side:
bridgeStep <- reactive({
bridgeKable1 <- bridgingTable()
opdate <- as.Date(input$OpDate)
dates <- as.Date(c(opdate - 6, opdate - 5, opdate - 4, opdate -3, opdate - 2, opdate - 1, opdate, opdate + 1, opdate + 2))
dates_chr <- format(as.Date(c(opdate - 6, opdate - 5, opdate - 4, opdate -3, opdate - 2, opdate - 1, opdate, opdate + 1, opdate + 2)), "%d/%m/%y")
dates_chr <- as.character(dates_chr)
wdays <- weekdays(dates)
tempDays <- cbind(dates, wdays)
if(input$thromRisk == "Low"){
finalBridge <- bridgeKable1
finalBridge <- kable(bridgeKable1, "html", booktabs = T) %>%
kable_styling(full_width = TRUE, position = "center") %>%
row_spec(0, bold = T) %>%
row_spec(7, color = "black", background = "#80c3e8", bold = "T")
}else if(input$thromRisk == "High"){
if(tempDays[7, 2] == "Tuesday" || tempDays[7, 2] == "Wednesday"){
finalBridge <- kable(bridgeKable1, "html", booktabs = T) %>%
kable_styling(full_width = TRUE, position = "center") %>%
row_spec(0, bold = T) %>%
row_spec(9, color = "black", background = "#80c3e8", bold = "T") %>%
column_spec(1, width = "8em") %>%
column_spec(5, width = "10em")
}else{
finalBridge <- kable(bridgeKable1, "html", booktabs = T) %>%
kable_styling(full_width = TRUE, position = "center") %>%
row_spec(0, bold = T) %>%
row_spec(7, color = "black", background = "#80c3e8", bold = "T") %>%
column_spec(1, width = "8em") %>%
column_spec(5, width = "10em")
}
}
return(finalBridge)
})
And this is the code used in Rmd:
library(knitr)
library(kableExtra)
bridgingInst <- bridgeStep()
print(bridgingInst)
And the error message I get on the print out is
Cannot visit /tmp/RtmpBqPaIe/viewhtml2146391b387/index.html because the browseURL function is disabled.
I've tried different browsers but get the same error, it happens even when run from rstudio.
I only recently revisited this app having not touch it for a long time and only noticed this error after adjusting some unrelated code. Grateful for any explanation or help.