4

I am trying to include a histogram created with qplot(ggplot2) with the code chunk

<<histAge, echo = F, message = F, warning = F, dev='tikz'>>=
  plot(hist.age)
@

It works just fine with dev='pdf', but doesn't work with dev='tikz'. The library tikzDevice is installed in R, tikz is included in the lyx document.

In case it matters, hist.age is a qplot with geom histogram.

The message in lyx says somewhere

Error in system(latexCmd, intern = T, ignore.stderr = T) : 'C:\Program' not found".

Overall error is Error: Cannot convert file.

I would really appreciate any help to make this work!

miller
  • 1,636
  • 3
  • 26
  • 55
Hengrui Jiang
  • 861
  • 1
  • 10
  • 23
  • Looks like a problem with spaces. I am guessing this issue is Windows-specific. If you have access to Ubuntu, my guess is it would work there. Please post a bug report *with a .lyx minimal example*. Please read this for more information: http://wiki.lyx.org/FAQ/MinimalExample – scottkosty Oct 09 '15 at 19:27
  • should I report this to lyx, knitr or tikzDevice? – Hengrui Jiang Oct 10 '15 at 07:16
  • Not sure. If you post a minimal example (see link above), I can give you my guess with whether I think it is a bug and what the root cause is. – scottkosty Oct 10 '15 at 16:07

1 Answers1

3

This should be an issue that has been reported earlier this year. Before the next version of tikzDevice (> 0.8.1) is on CRAN, you need to install the development version:

devtools::install_github('yihui/tikzDevice')

Since you are on Windows, you will need RTools.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419