I would like to include this util.stan file
int[] rep_int(int x, int n){
int out_int[n];
for(i in 1:n) out_int[i] = x;
return out_int;
}
And include it in this way in a stan script
functions{
#include util.stan
I simply added the util.stan file to the inst/stan directory and built the package using Rstudio
and I get this error
PARSER FAILED TO PARSE INPUT COMPLETELY
STOPPED AT LINE 1:
int[] rep_int(int x, int n){
int out_int[n];
for(i in 1:n) out_int[i] = x;
return out_int;
}
Error in rstan::stanc(file_name, allow_undefined = TRUE, obfuscate_model_name = FALSE) :
failed to parse Stan model 'util' due to the above error.
Calls: <Anonymous> -> sapply -> lapply -> FUN -> <Anonymous>
Execution halted
ERROR: configuration failed for package ‘ARMET’
* removing ‘/stornext/Home/data/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.6/ARMET’
* restoring previous ‘/stornext/Home/data/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.6/ARMET’
Exited with status 1.
Am I missing something?