I’m using the code below Rtools is install but I noticed when i go to this directory i don’t have Rcpp.h:27 but I do have Rcpp.h. Its like this on all the files. Please help. Thanks
format_code
pkgbuild::has_build_tools(debug = TRUE)
remotes::install_github("bgoodri/inline")
library(StanHeaders)
library(rstan)
values = list(y = rnorm(1000,5,3))
model ="
data {
real y[1000];
}
parameters {
real mu;
real sigma;
}
model {
mu ~ normal(0,10);
sigma ~ normal(0,10);
y ~ normal(mu,sigma);
}
"
fit <- stan(model_code = model, data = values, warmup = 500, iter = 1000, chains = 4, cores = 2, thin = 1)
posterior = extract(fit)
I keep getting this error message
Error in compileCode(f, code, language = language, verbose = verbose) :
In file included from C:/Users/thean/AppData/Local/Temp/Rtmp0kEsrn/downloaded_packages/rJava_0.9-13.zip/Rcpp/include/RcppCommon.h:29, from C:/Users/thean/AppData/Local/Temp/Rtmp0kEsrn/downloaded_packages/rJava_0.9-13.zip/Rcpp/include/Rcpp.h:27, from file25c07a3a6abc.cpp:7:C:/Users/thean/AppData/Local/Temp/Rtmp0kEsrn/downloaded_packages/rJava_0.9-13.zip/Rcpp/include/Rcpp/r/headers.h:71:10: fatal error: R.h: No such file or directory #include <R.h> ^~~~~compilation terminated.make: *** [C:/PROGRA~1/R/R-40~1.1/etc/x64/Makeconf:229: file25c07a3a6abc.o] Error 1
If you need to use math formula, use Latex syntax: