简体   繁体   中英

How can I install RStan?

I am having troubles installing RStan. Anytime I try, my code returns 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

Once it gives me the WARNING message, it asks me if I want to install Rtools. I click "Yes" and then it returns [1] FALSE. And Rtools is not installed. Could someone advise please?

Operating System: Windows 10

Interface Version: RStan.

Compiler/Toolkit: g++

You'll need to install RTools on Windows (please check your R version and choose correct RTools version).

However, without RTools, probably the easiest way is to just run:

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

(Binary version shouldn't require RTools nor any compiler.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM