Question

I am doing a discrepancy analysis in R and have problems displaying the tree with graphviz. I did everything as described in Studer et al 2011 (in: Guillet et al: Advances in Knowledge Discovery and Management). I use the disstree command to build my tree called tree.lcp and then try to display it with graphviz:

seqtree2dot(tree.lcp, filename="hh.lcp", seqdata=seqhh)

shell("dot -Tsvg -O hh.lcp.dot") 

There is no problem with the first command but the second brings this error message:

Can not find command "dot" .
Error messages:
1: command 'C:\Windows\system32\cmd.exe /c dot -Tsvg -O hh.lcp.dot' gave status 1
2: In shell("dot -Tsvg -O hh.lcp.dot") : 'dot -Tsvg -O hh.lcp.dot' process failed - error code 1

I suppose it has something to do with th path command (see GraphViz: Windows PATH not set with new installer, issue when calling from R) but I installed GraphViz to C:\Program Files (x86)\Graphviz2.36 which I understand is the default.

Any idea, where the problem lies? And how could I include the path in the shell-command if the problem is still the path command?

Thanks! Katharina

Was it helpful?

Solution

You can specify the path as follows

shell(paste('"C:/Program Files (x86)/Graphviz2.36/dot"','-Tsvg -O hh.lcp.dot'))

However, if you want to plot a tree from dissimilarities between sequences, you are probably better to use the newer simplified seqtreedisplay function that generates the plot directly from the seqtree object, i.e., the outcome of the seqtree function. Normally, seqtreedisplay should find Graphviz by itself.

For more details, look at the help page by typing help(seqtreedisplay).

OTHER TIPS

The latest TraMineR version has a new function that run everything directly. The function is called seqtreedisplay.

seqtreedisplay(tree.lcp, type="d")

Try running: TraMineR.checkupdates() to know if you have the latest stable version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top