Installing in Windows - advice please

If you put this in the beginning of your R program it should work:

Sys.setenv("GVPATH" = "C:\\Program Files (x86)\\Graphviz 2.45.20200623.1728")

This is what it renders for me:

Initially, I got a slightly different error message that you, so if it still doesn’t work for you, check your RStudio version. I have Version 1.3.959. You might need to upgrade.

My error message was:

> seqtreedisplay(st, type = "d", border = NA)
The system cannot find the path specified.
Error in disstreedisplayInternal(tree = tree, filename = filename, tmpdisstree = tmpdisstree,  : 
   [!] GraphViz was not found. If you haven't, please install GraphViz to use this function: see http://www.graphviz.org
 [!] If GraphViz is installed on your computer, you need to specify the GraphViz installation directory using the argument gvpath='installdir'
 [!] You can also add this directory to the PATH environment variable
 [!] GraphViz installation directory usually looks like 'C:\Program Files\GraphViz'

I checked my PATH and it was:

> Sys.getenv("PATH")
[1] "C:\\Program Files\\R\\R-4.0.2\\bin\\x64;C:\\Python38\\Scripts\\;C:\\Python38\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Users\\magja\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\magja\\Bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build;C:\\Users\\magja\\graphviz-helpers\\Bin;C:\\Program Files (x86)\\Graphviz 2.45.20200623.1728\\bin"

It looks correct, but for some reason it doesn’t work without the solution above.

I got it from reading the source code for TraMineR’s disstree2dot.R