标签: r
我正在创建.rmd文件,如何将字符串分配到<script></script>代码段
<script></script>
```{r results='asis'} string<-"test" ``` <script> var js_string = "......" </script>
答案 0 :(得分:3)
这对我有用:
--- title: "Untitled" author: "Roman Luštrik" date: "24. avgust 2015" output: html_document --- ```{r results='asis'} string<-"test" ``` <script> var js_string = `r dQuote(string)` </script>