R Brilhante incluiHTML ausente em htmlWidgets em um contexto reativo
UPDATE: postei uma pergunta relacionadaaqui
Eu preciso incluir um arquivo html em brilhante usando includeHTML. O arquivo é gerado pelo rmarkdown e possui um grande número de htmlWidgets.
Shiny está mostrando o arquivo html, mas os htmlWidgests estão ausentes. O problema ocorre apenas quando o includeHTML está no server.R, mas funciona bem se o includeHTLM estiver no ui.R. Eu preciso atualizar o arquivo.html, para que o includeHTML seja usado em um contexto reativo.
O file.rmd é algo como isto
---
title: "test"
author: "me"
date: '`r Sys.Date()`'
output: html_document
---
```{r}
df<- data.frame(a = c(1:10), b = c(1:10))
rpivotTable::rpivotTable(df , rows = 'a' , cols= 'b' )
rpivotTable::rpivotTable(df , rows = 'a' , cols= 'b' )
rpivotTable::rpivotTable(df , rows = 'a' , cols= 'b' )
```
depois renderize para file.html
rmarkdown::render( input = 'file.RMD' )
Este aplicativo brilhante está OK
ui <- shinyUI(
fluidPage(
includeHTML('file.html')
)
)
server <- function(input, output) { }
shinyApp(ui, server)
MAS este não funciona.
ui <- shinyUI(
fluidPage(
uiOutput('tables')
)
)
server <- shinyServer(function(input, output) {
output$tables <- shiny::renderUI(
includeHTML('file.html')
)
})
shinyApp(ui, server)