I'd like to locate the specific chunk (or better yet, line of code) that generates a warning message when compiling a knitr PDF in RStudio. This is the final piece of info that knitr outputs after successfully running every chunk:
..... output file: file.tex [1] "file.tex" Warning message: In bmerge(i, x, leftcols, rightcols, io <- FALSE, xo, roll = 0, : A known encoding (latin1 or UTF-8) was detected in a join column. data.table compares the bytes currently, so doesn't support *mixed* encodings well; i.e., using both latin1 and UTF-8, or if any unknown encodings are non-ascii and some of those are marked known and others not. But if either latin1 or UTF-8 is used exclusively, and all unknown encodings are ascii, then the result should be ok. In future we will check for you and avoid this warning if everything is ok. The tricky part is doing this without impacting performance for ascii-only cases. Running xelatex on file.tex...completed Created PDF: ~/Documents/file.pdf
Why is the warning not displayed with the chunk that generated it? In an effort to locate its source, I've tried turning on opts_chunk$set(warning=TRUE, message=TRUE, echo=TRUE
, but the warning message doesn't show up in the final PDF. I've also stepped through the many chunks individually and don't seem to get this warning in the R console (in fact I only employ a single merge()
and the by=
is an integer). Any other suggestions for tracking it down? I'm running the latest CRAN versions of knitr 1.8 and data.table 1.94, along with RStudio 0.98.1091.