无法在FlexDashboard中渲染HTML文档
我正在尝试使用Shiny在FlexDashbaord中渲染HTML文档。我正在使用一些代码从用户给出的输入中产生HTML文件。
:在
这里
---
title: "Report"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
theme:
version: 3
bootswatch: yeti
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(highcharter)
library(gt)
library(htmltools)
library(viridis)
library(dplyr)
library(ggplot2)
library(shiny)
Column {.sidebar}
-----------------------------------------------------------------------
```{r echo=FALSE}
selectInput("select_year",
label = "Year",
choices = c("2012", "2013", "2014"))
hr()
selectInput("select_code",
label = "Course",
choices = c("i12", "i13", "i14"))
hr()
selectInput("select_title",
label = "Select a Discussion",
choices = c("Discussion on..",
"Twitter trolls…",
"NBA…"))
hr()
actionButton("update", "List Discussions",
icon("refresh"),
class = "btn btn-primary")
Row
----------------------------------------------------------
reactive({
htmltools::includeHTML(
input$update,
map1 %>%
filter(Year == isolate(input$select_year)) %>%
filter(course_code == isolate(input$select_code)) %>%
filter(Title == isolate(input$select_title)) %>%
filter(text %in% sample(unique(text))) %>%
dplyr::mutate(review = get_sentences(comments)) %$%
sentiment_by(review, text) %>%
highlight("highlights.html")
)
})```
数据 将其渲染在仪表板
如何访问从代码生成的此HTML文件以在我的FlexDashboard上显示?
I am trying to render an HTML document inside Flexdashbaord using shiny. I am using some code to produce an HTML file from the inputs processed given by the user.
Data: here
Below is the code:
---
title: "Report"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
theme:
version: 3
bootswatch: yeti
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(highcharter)
library(gt)
library(htmltools)
library(viridis)
library(dplyr)
library(ggplot2)
library(shiny)
Column {.sidebar}
-----------------------------------------------------------------------
```{r echo=FALSE}
selectInput("select_year",
label = "Year",
choices = c("2012", "2013", "2014"))
hr()
selectInput("select_code",
label = "Course",
choices = c("i12", "i13", "i14"))
hr()
selectInput("select_title",
label = "Select a Discussion",
choices = c("Discussion on..",
"Twitter trolls…",
"NBA…"))
hr()
actionButton("update", "List Discussions",
icon("refresh"),
class = "btn btn-primary")
Row
----------------------------------------------------------
reactive({
htmltools::includeHTML(
input$update,
map1 %>%
filter(Year == isolate(input$select_year)) %>%
filter(course_code == isolate(input$select_code)) %>%
filter(Title == isolate(input$select_title)) %>%
filter(text %in% sample(unique(text))) %>%
dplyr::mutate(review = get_sentences(comments)) %$%
sentiment_by(review, text) %>%
highlight("highlights.html")
)
})```
I cannot find a way to render it inside the dashboard
How can I access this HTML file generated from the code to display on my flexdashboard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
InclubelHTML函数的路径为参数。您必须首先渲染HTML,然后调用它。 BU如果使用“运行时:闪亮”,则无法使用生成的HTML。
The includeHTML function has path as parameter. You have to render first the html and then call it. Bu If you use "runtime: shiny" you can't use the generated html.