【发布时间】:2021-04-17 21:28:23
【问题描述】:
我有以下创建 flexdashboard 的代码:
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
我想插入一些 HTML 和 javascript 代码。我试过这个
Column
-----------------------------------------------------------------------
### Block 1
```{r}
<p>"This is a paragraph"</p>
<script>
alert("This is an alert")
</script>
```
但它不起作用。拜托,你能帮我解决这个问题吗?谢谢。
【问题讨论】:
-
您将 HTML 和 JS 代码包装在 R 块中,这会导致错误。只需将代码直接放在您的 Rmd 中即可。此外,您的结束脚本标记应为
</script> -
标签已解决。谢谢斯特凡
标签: html r flexdashboard