我不知道为什么会出现此错误。
因为我已经提前将所有环境变量、rtools、r、rstudio 和主路径设置为 D:\DANNY HUANG\Documents
正确
附言由于操作系统盘空间不足,我将安装程序的路径设置为D盘,
> install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
trying URL 'https://cloud.r-project.org/bin/windows/contrib/4.0/rstan_2.21.2.zip'
Content type 'application/zip' length 5225165 bytes (5.0 MB)
downloaded 5.0 MB
package ‘rstan’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:\Users\DANNY HUANG\AppData\Local\Temp\Rtmp2D2Wbi\downloaded_packages
>example(stan_model, package = "rstan", run.dontrun = TRUE)
Loading required package: StanHeaders
Loading required package: ggplot2
Error: package or namespace load failed for ‘rstan’:
.onLoad failed in loadNamespace() for 'processx', details:
call: loadNamespace(name)
error: there is no package called ‘ps’