【发布时间】:2015-05-25 04:04:59
【问题描述】:
感谢您提供有趣的 RAPPORT 软件包。我想使用 RStudio 在 R Markdown 文档中创建一个关系表,但它传递了 knitr 命令,而不是为表创建 html 代码。当我在 R 命令行中一一运行命令时,它可以工作。
这是 Markdown 代码块:
{r t, cache=FALSE }
rpt = rapport.html('Descriptives.tpl', data=chrt.patients, var="RACE",file.name="Race",file.path="c://hdds//work//california//R Analysis/tmp")
这是我使用 knitrHtml 按钮编译 R Markdown 时的输出:
<p> &quot;## Description&quot; attr(,&quot;class&quot;) [1] &quot;knit_asis&quot; attr(,&quot;knit_cacheable&quot;) [1] TRUE[1] &quot;template will return descriptive statistics of a numerical or frequency table of a categorical variable.&quot;
这是我逐行执行代码并得到正确结果时的输出:
<h2 id="description">Description</h2>
<p>This template will return descri\ptive statistics of a numerical or frequency table of a categorical variable.</p>
<h3 id="race"><em>RACE</em></h3>
【问题讨论】:
-
我认为这个问题已经被
pander的最新版本(0.5.2)解决了。你能分享你的sessionInfo()吗?另外,您能否分享一下为什么在knitr中使用rapport的用例?我对此很感兴趣。谢谢,Gergely