在 lyx 中使用 tikzDevice 不起作用

Using tikzDevice in lyx doesn't work

我正在尝试将使用 qplot(ggplot2) 创建的直方图包含在代码块

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

它在 dev='pdf' 上工作得很好,但在 dev='tikz' 上不起作用。库 tikzDevice 安装在 R 中,tikz 包含在 lyx 文档中。

以防万一,hist.age 是具有 geom 直方图的 qplot

lyx 中的消息在某处说

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

Overall error is Error: Cannot convert file.

如果您能帮助我完成这项工作,我将不胜感激!

这应该是今年早些时候 has been reported 的一个问题。 tikzDevice> 0.8.1)下一个版本上线前,需要安装开发版:

devtools::install_github('yihui/tikzDevice')

由于您在 Windows,您将需要 RTools