gpt4 book ai didi

r - 使用R包brms时出错

转载 作者:行者123 更新时间:2023-12-02 10:49:48 26 4
gpt4 key购买 nike

我想使用R包brms,但是出现了一个我无法解释的错误。它可能与Rtools有关,但它已安装在我的计算机上。

这是brms包中的示例:

 fit1 <- brm(count ~ log_Age_c + log_Base4_c * Trt_c 
+ (1|patient) + (1|visit) + (1|obs),
data = epilepsy, family = poisson(),
prior = c(set_prior("student_t(5,0,10)", class = "b"),
set_prior("cauchy(0,2)", class = "sd")))

这是我得到的错误:

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
c:/Rtools/mingw_64/bin/g++: not found
make: *** [file202834c75e9.o] Error 127
Warning message:
l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-33~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file202834c75e9.dll" WIN=64 TCLBIN=64 OBJECTS="file202834c75e9.o"' renvoie un statut 2
In addition: Warning message:
running command 'C:/PROGRA~1/R/R-33~1.0/bin/x64/R CMD SHLIB file202834c75e9.cpp 2> file202834c75e9.cpp.err.txt' had status 1



谢谢你的帮助

最佳答案

确实,这是Rtools的问题。 system("g++ -v")给您什么?如果状态为127,则R无法找到Rtools。很可能是,在Rtools安装过程中没有要求您修改系统路径的复选框。我建议您取消安装Rtools并重新安装它,并确保选中此框。另请确认您使用的Rtools版本与您的R版本兼容。

关于r - 使用R包brms时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37645418/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com