Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何安装RStan?_R_Rstan - Fatal编程技术网

如何安装RStan?

如何安装RStan?,r,rstan,R,Rstan,我在安装RStan时遇到问题。只要我尝试,我的代码就会返回False install.packages("rstan") pkgbuild::has_build_tools(debug = TRUE) Scanning R CMD config CC... cc_path: '' does not exist Scanning path... Scanning registry... WARNING: Rtools is required to build R packa

我在安装RStan时遇到问题。只要我尝试,我的代码就会返回False

install.packages("rstan")
pkgbuild::has_build_tools(debug = TRUE)
Scanning R CMD config CC...
cc_path:  
'' does not exist
Scanning path...
Scanning registry...
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/.
[1] FALSE
一旦它向我发出警告消息,它就会询问我是否要安装Rtools。我单击Yes,然后返回[1]FALSE。并且没有安装Rtools。有人能给我建议吗

操作系统:Windows 10

接口版本:RStan

编译器/工具包:g++

您需要在Windows上安装。请检查您的R版本并选择正确的RTools版本

但是,如果没有RTools,最简单的方法可能是运行:

install.packages("rstan", type = "binary", dependencies = TRUE, repos = "https://cloud.r-project.org")

二进制版本不需要RTools,也不需要任何编译器。

您说您让touble安装RTools,但您的输出表明您正在尝试安装rstan…谢谢您指出这一点。为了清楚起见,我编辑了我的问题。我正在尝试安装RStan,但它说我必须先安装Rtools。但是,当我尝试安装Rtools.Ok时,它返回FALSE。谢谢但是您的代码片段仍然引用rstan。也许您可以重新启动R/Rstudio,然后尝试安装。。。同样的错误信息?编译一个定制的STAN模型,是否需要一个C++编译器,也就是RoToice?@ USER 20650,谢谢,好的,这是真的。但是Andrew可以尝试在RStudio之外单独安装RTools,如果这不起作用,我希望可以配置rstan以在中使用可用的g++编译器,可能没有尝试或需要。我同意Petr,如果他们手动安装rtools exe,并按照您提供的链接上的说明将其添加到他们的路径中,他们应该不会有问题。