0

Thank you for the interesting package RAPPORT. I want to create a rapport table in a R Markdown document using RStudio but it passes the knitr commands instead of creating html code for table. It works when I run commands one by one in R command line.

Here is the Markdown code chunk:

{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")

Here is its output when I compile R Markdown using knitrHtml button:

<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;

Here is the output when I execute code line by line and have the right results:

<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>
AShojaee
  • 11
  • 1
  • 3
  • I think this issue was resolved by the most recent version (0.5.2) of `pander`. Can you please share your `sessionInfo()`? Also, can you please share your use case on why using `rapport` inside of `knitr`? I am really interested in this. Thanks, Gergely – daroczig May 26 '15 at 04:16

1 Answers1

0

I found the answer int this post by Julian: disabling the knitr.auto.asis option in pander and manually setting results='asis' in knitr.

Workaround with asis

{r results='asis'} panderOptions('knitr.auto.asis', FALSE) pander(list(a=c(1,2,3),b=c('A','b') ) )

Community
  • 1
  • 1
AShojaee
  • 11
  • 1
  • 3