I am currently learning module development, I am trying to develop a module based on the stan package MCMC for Bayesian inference. I followed the tutorial to write a function that can call stan, but I got an error in jamovi. The error code in developer mode is as follows
Code: Select all
Debug Error in file(con, "r"): cannot open the connection private$.run()
stan(model_code = mode, data = stan_data, iter = 27000, warmup = 2000, chains = 4, cores = 4)
stan_model(file, model_name = model_name, model_code = model_code, stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, save_dso = save cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap(\"", model_name, "\");", sep = ""), includes = inc, plugin = "rstan", save_dso = sav pkgbuild::with_build_tools(cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, ..., verbose = verbose)) withr::with_path(rtools_path(), code) force(code)
cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, ..., verbose = verbose) compileCode(f, code, language = language, verbose = verbose) readLines(errfile)
file(con, "r")
Code: Select all
devtools::install()
library(learn)
data = ToothGrowth
learn::tteststan(
data = data,
dep = "len",
group = "supp")
Error in cpp_object_initializer(.self, .refClassDef, ...) :
could not find function "cpp_object_initializer"
In addition: Warning messages:
1: In FUN(X[[i]], ...) : data with name X1 is not numeric and not used
2: In FUN(X[[i]], ...) : data with name X2 is not numeric and not used
failed to create the sampler; sampling not done
Jmo file and source code I uploaded in Google Cloud
jmo:https://drive.google.com/file/d/1551f3- ... sp=sharing
all:https://drive.google.com/file/d/1eYttHW ... sp=sharing
My English is not very good, so I sent this post with Google Translate. There may be places that are difficult to understand.
Thank