set_cmdstan_path() function to tell CmdStanR where the
CmdStan installation in located. Once the path has been set,
cmdstan_path() will return the full path to the CmdStan installation and
cmdstan_version() will return the CmdStan version number. See Details
for how to avoid manually setting the path in each R session.
set_cmdstan_path(path = NULL) cmdstan_path() cmdstan_version()
The full file path to the CmdStan installation as a string. If
A string. Either the file path to the CmdStan installation or the CmdStan version number.
Before the package can be used it needs to know where the CmdStan installation is located. When the package is loaded it tries to help automate this to avoid having to manually set the path every session:
If the environment variable
"CMDSTAN" exists at load time
then its value will be automatically set as the default path to CmdStan for
the R session.
If no environment variable is found when loaded but any directory in the form
".cmdstanr/cmdstan-[version]", for example
exists in the user's home directory (
not the current working directory) then the path to the cmdstan with the largest
version number will be set as the path to CmdStan for the R session.
This is the same as the default directory that
install_cmdstan() would use to
install the latest version of CmdStan.
It is always possible to change the path after loading the package using