I am having problem making ggplot2, tikzDevice, and knitr working together. I used a very simple example: ---------------------------example.Rnw----------------------------- \documentclass[preview]{standalone}
\begin{document} \begin{figure} <<fig1,eval=TRUE,echo=FALSE,dev='tikz'>>= library(ggplot2) qplot(displ, hwy, data = mpg, colour = factor(cyl)) @ \end{figure} \end{document} --------------------------------------------------------------------------------- I got "... ! ==> Fatal error occurred, no output PDF file produced! label: fig1 (with options) List of 3 $ eval: logi TRUE $ echo: logi FALSE $ dev : chr "tikz" Error in process_file(text, output) : Quitting from lines 6-8: (test_Rnw.Rnw) Error in getMetricsFromLatex(TeXMetrics) : TeX was unable to calculate metrics for the following string or character: hwy Common reasons for failure include: * The string contains a character which is special to LaTeX unless escaped properly, such as % or $. * The string makes use of LaTeX commands provided by a package and the tikzDevice was not told to load the package. The contents of the LaTeX log of the aborted run have been printed above, it may contain additional details as to why the metric calculation failed. Calls: knit -> process_file Execution halted" Best, Shige [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.