I'm using the Hmisc latex command to print a summary table generated by summary() in an Rmd document in Rstudio. It works fine with the results='asis' option specified, however there is a spurious line that appears in my PDF file:
%latex.default(summary(cars), file = “”)%
I think knitr must be somehow escaping this comment such that it gets transferred verbatim to the output. Anyone know how I can suppress this behavior?
This is the contents of my .Rmd file:
---
title: "Untitled"
author: "John Smith"
date: "August 22, 2015"
output: pdf_document
---
```{r, results='asis', echo=FALSE, message=FALSE}
library(Hmisc)
latex(summary(cars), file="")
```
When I render it, I get a PDF that includes the phrase "%latex.default(summary(cars), file=`')%"
I'm using R version 3.2.1 (2015-06-18) on Mac OS X Darwin 12.6.0 and Knitr 1.11
ideas?
Peter