I am trying to compile a function stored in a separate file.
The file I am trying to compile looks like this:
functions {
#include hat_ode.stan
}
model{
}
stanc returns
could not find include file: #include hat_ode.stan
Error in stanc(file = "expose_ode.stan") :
failed to parse Stan model 'expose_ode' due to the above error.
I’ve followed @bgoodri advice from a nother thread - flush left, no trailing whitespace - without any luck.
In addition, I have tried specifying the include file name as ./hat_ode.stan and also with it’s full path.
list.files() confirms that the main program file and hat_ode.stan are in the directory that I am running R in.
ff <- stanc("mymain.stan")
could not find include file: #include myfunc.stan
Error in stanc("mymain.stan") :
failed to parse Stan model 'mymain' due to the above error.