Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphViz: Windows PATH not set with new installer, issue when calling from R

Tags:

r

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.

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.

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.

Any idea, on how I can proceed in order to produce the image file? Or find dot?

like image 487
Matthias Studer Avatar asked Aug 20 '13 12:08

Matthias Studer


People also ask

How do I set the path in graphviz?

Graphviz on Windows In Advance settings, a dialogue box opens that shows the Environment Variables button. Click the button. Select the entry Path in the system variables section and add C:\Program Files (x86)\GraphvizX. XX\bin to the existing path.

How do I know if I have Graphviz on Windows?

Run "dot -V" from the command prompt. If GraphViz is installed and configured you'll get it's version.


2 Answers

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.

like image 180
north at graphviz Avatar answered Oct 05 '22 23:10

north at graphviz


You have a valid concern, which is why we tried to alter the PATH in previous releases. First, yes, we will probably keep C:\Program Files (x86)\Graphviz(VersionNumber) as the default installation path. Second, if anyone can tell us how to alter the PATH safely at install time, we would appreciate it. Another possibility is to have the installation process set a Graphviz specific variable like GVPATH that records the directory containing dot.

like image 38
Emden Avatar answered Oct 06 '22 00:10

Emden