> Sys.getenv("BINPREF")
[1] ""
> readLines("~/.R/Makevars.win")
Error in file(con, "r") : no se puede abrir la conexiĂłn
Además: Warning message:
In file(con, "r") :
no fue posible abrir el archivo 'C:\Users\Y7514957C\Documents/.R/Makevars.win': No such file or directory
> readLines("~/.Rprofile")
Error in file(con, "r") : no se puede abrir la conexiĂłn
Además: Warning message:
In file(con, "r") :
no fue posible abrir el archivo 'C:\Users\Y7514957C\Documents/.Rprofile': No such file or directory
> readLines("~/.Renviron")
[1] "PATH=\"${RTOOLS40_HOME}\\usr\\bin;${PATH}\""
Where no fue posible abrir el archivo means the file cannot be opened.
> Sys.getenv("PATH")
[1] "C:\\rtools40\\usr\\bin;C:\\Users\\Y7514957C\\Miniconda3\\Rtools\\bin;C:\\Users\\Y7514957C\\Miniconda3\\Rtools\\mingw_64\\bin;C:\\Users\\Y7514957C\\Miniconda3;C:\\Users\\Y7514957C\\Miniconda3\\Library\\mingw-w64\\bin;C:\\Users\\Y7514957C\\Miniconda3\\Library\\usr\\bin;C:\\Users\\Y7514957C\\Miniconda3\\Library\\bin;C:\\Users\\Y7514957C\\Miniconda3\\Scripts;C:\\Users\\Y7514957C\\Miniconda3\\bin;C:\\Users\\Y7514957C\\Miniconda3\\condabin;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0;C:\\Program Files\\AutoFirma\\AutoFirma;C:\\WINDOWS\\System32\\OpenSSH;C:\\Program Files\\PuTTY;C:\\Users\\Y7514957C\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Y7514957C\\AppData\\Local\\Programs\\Git\\cmd;C:\\Users\\Y7514957C\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\Y7514957C\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Y7514957C\\AppData\\Local\\Microsoft\\WindowsApps;."
>
> Sys.which("make")
make
"C:\\rtools40\\usr\\bin\\make.exe"
When running rstan:
Compilation ERROR, function(s)/method(s) not created!
Error in compileCode(f, code, language = language, verbose = verbose) :
C:/Users/Y7514957C/Miniconda3/Lib/R/library/rstan/lib/x64/libStanServices.a(stan_fit.o):stan_fit.cpp:(.text$_ZN4stan8services4util20run_adaptive_samplerINS_4mcmc24adapt_dense_e_static_hmcINS_5model10model_baseEN5boost6random23additive_combine_engineINS8_26linear_congruential_engineIjLj40014ELj0ELj2147483563EEENSA_IjLj40692ELj0ELj2147483399EEEEEEES6_SD_EEvRT_RT0_RSt6vectorIdSaIdEEiiiibRT1_RNS_9callbacks9interruptERNSP_6loggerERNSP_6writerESV_[_ZN4stan8services4util20run_adaptive_samplerINS_4mcmc24adapt_dense_e_static_hmcINS_5model10model_baseEN5boost6random23additive_combine_engineINS8_26linear_congruential_engineIjLj40014ELj0ELj2147483563EEENSA_IjLj40692ELj0ELj2147483399EEEEEEES6_SD_EEvRT_RT0_RSt6vectorIdSaIdEEiiiibRT1_RNS_9callbacks9interruptERNSP_6loggerERNSP_6writerESV_]+0x55c): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'C:/Users/Y7514957C/Miniconda3/Lib/R/library/rstan/lib/x64/libSta
Además: Warning messages:
1: In find.package(package, lib.loc, verbose = verbose) :
package 'base' found more than once, using the first from
"C:/Users/Y7514957C/Miniconda3/lib/R/library/base",
"C:/Users/Y7514957C/Miniconda3/Lib/R/library/base"
2: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
An object of class “CFunc”
function (x, y)
.Primitive(".Call")(<pointer: 0x0000000063f41430>, x, y)
<environment: 0x00000000129add48>
Slot “code”:
[1] “\n// includes from the plugin\n#include <R.h>\n#include <Rdefines.h>\n#include <R_ext/Error.h>\n\n\n// user includes\n\n\n// declarations\nextern “C” {\nSEXP file3c489914b2f( SEXP x, SEXP y) ;\n}\n\n// definition\n\nSEXP file3c489914b2f( SEXP x, SEXP y ){\nreturn ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ; \nRf_warning(“your C++ program does not return anything”); \n return R_NilValue ; \n}\n\n\n”
Happy to help! Once you’ve changed the PATH variable, restart R and try install rstan and StanHeaders from source again, hopefully it should work without issue