tikzDevice包未在R GUI中加载

tikzDevice包未在R GUI中加载,r,R,在R GUI上加载tikz包时遇到问题: > require(tikzDevice) Loading required package: tikzDevice Warning message: In fun(libname, pkgname) : tikzDevice: No appropriate LaTeX compiler could be found. Access to LaTeX is required in order for the TikZ device to pro

在R GUI上加载tikz包时遇到问题:

> require(tikzDevice)
Loading required package: tikzDevice
Warning message:
In fun(libname, pkgname) : 

tikzDevice: No appropriate LaTeX compiler could be found.
Access to LaTeX is required in order for the TikZ device
to produce output.

The following places were tested for a valid LaTeX compiler:

    the global option: tikzLatex
    the environment variable: R_LATEXCMD
    the environment variable: R_PDFLATEXCMD
    the global option: latexcmd
    the PATH using the command: pdflatex
    the PATH using the command: latex
    the PATH using the command: /usr/texbin/pdflatex

If you have a working LaTeX compiler, try one of the
following solutions:

    Set the path to your compiler as the value of either latexcmd or
    tikzLatex in .Rprofile using options().

    Set the path to your compiler as the value of either R_LATEXCMD or
    R_PDFLATEXCMD in .Renviron.

    Ensure the folder containing your compiler is included in PATH.
现在奇怪的是,当我使用终端时,我能够很好地运行我的脚本。你知道GUI发生了什么吗


我正在MacOS 10.12.3上运行R3.3.2。我使用MacTEX下载的TexShop。

这可以很容易地解决:

options(tikzLatex = "PATH")
用LaTeX编译器的路径替换路径。对于Mac用户,您可以通过在终端中键入以下内容来找到答案:

which pdflatex

这很容易解决,因此:

options(tikzLatex = "PATH")
用LaTeX编译器的路径替换路径。对于Mac用户,您可以通过在终端中键入以下内容来找到答案:

which pdflatex

这可能对最近升级了操作系统的其他Mac用户有用。这对我来说很有效,与tikzDevice软件包无关,但与latex无法编译有关,因为编译pdflatex的路径已被Mac删除(请参阅el Capitan上的完整解释,因为当时苹果开始阻止用户在usr/文件夹中安装latex项目)。
我建议如下:

  • 下载并安装MacTex
  • 指定要在texshop/texworks而不是usr/bin put/Library/TeX/TeX-bin中编译的路径
  • 现在检查tikzDevice是否在您的GUI中工作(应该是现在!)

  • 这可能对最近升级了操作系统的其他Mac用户有用。这对我来说很有效,与tikzDevice软件包无关,但与latex无法编译有关,因为编译pdflatex的路径已被Mac删除(请参阅el Capitan上的完整解释,因为当时苹果开始阻止用户在usr/文件夹中安装latex项目)。
    我建议如下:

  • 下载并安装MacTex
  • 指定要在texshop/texworks而不是usr/bin put/Library/TeX/TeX-bin中编译的路径
  • 现在检查tikzDevice是否在您的GUI中工作(应该是现在!)