问题描述
在R库中,我正在使用dot
程序(来自GraphViz)来生成一些图形(通常为png格式). dot
是通常的可执行文件,我通过system
R命令执行它.到目前为止,一切都运行良好,因为GraphViz安装程序已将dot
添加到PATH环境变量中.我只是在问用户安装GraphViz.
In an R library, I am using the dot
program (from GraphViz) to produce some graphics (usually in png format). dot
is a usual executable and I execute it through the system
R command. Until now, everything was running fine because the GraphViz installer was adding dot
to the PATH environment variable. I was just asking users to install GraphViz.
从2.31版开始(请参见 http://www.graphviz.org/Download_windows.php ),GraphViz不再更新PATH环境变量,因此,调用dot
失败(这不足为奇).因为该库的用户通常不是计算机专家,所以我不能要求他们更新PATH以便包含GraphViz.
Since version 2.31 (see http://www.graphviz.org/Download_windows.php), GraphViz no longer updates the PATH environment variable and, hence, calling dot
fails (this is not a surprise). Because the users of the library are usually not computer experts, I cannot ask them to update the PATH in order to include GraphViz.
该库分布在CRAN上.因此,我无法分发可执行文件(或任何已编译的代码).我主要需要Windows的解决方案,因为这似乎不会影响Linux或Mac.
The library is distributed on the CRAN. For this reason, I cannot distribute executable (or any compiled code). I mainly need a solution for Windows, since this not seems to affect Linux or Mac.
任何想法,关于如何进行操作以生成图像文件?还是找到dot
?
Any idea, on how I can proceed in order to produce the image file? Or find dot
?
推荐答案
我们决定在安装过程中不设置PATH.鉴于我们对Windows的多种形式的了解有限,因此以便携式方式进行此操作存在很多麻烦.弄错了它的巨大弊端是,您浪费了一些糟糕的非计算机专家"的PATH,并且它们无法恢复.我们在Graphviz的Windows下载页面上对此效果进行了记录.我同意设置.Rprofile.如果出了什么问题,至少可以限制损失.
We decided not to set PATH during installation. We had a lot of trouble doing this in a portable way, given our limited knowledge of Windows in its many forms. The huge downside of getting it wrong is that you trash some poor "not computer expert"'s PATH and they can't recover. We made a note to this effect on the Windows download page for Graphviz. I agree about setting .Rprofile. At least you limit the damage if something goes wrong.
这篇关于GraphViz:未使用新安装程序设置Windows PATH,从R调用时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!