r - R:运行 stan() 函数得到一些错误:
问题描述
当我运行 stan() 函数时,我收到关于文件中的错误(con,“r”)的两个错误:无法打开连接和接收器中的错误(类型 =“输出”):无效连接。顺便说一句,我的 .stan 文件是正确的。请帮忙。
> rstan:::rstudio_stanc("8schools.stan")
8schools.stan is syntactically correct.
> schools_dat <- list(J = 8,
+ y = c(28, 8, -3, 7, -1, 1, 18, 12),
+ sigma = c(15, 10, 16, 11, 9, 11, 10, 18))
> fit_8schools <- stan(file = 'C:/Users/.../Desktop/8schools.stan', data = schools_dat)
The NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at
https://github.com/stan-dev/stanc3/issues
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
Error in file(con, "r") : cannot open the connection
In addition: Warning messages:
1: In file.remove(c(unprocessed, processed)) :
cannot remove file 'C:\Users\lpb\AppData\Local\Temp\RtmpW6qdvg\file1f7436407ba4.stan', reason 'No such file or directory'
2: In system(cmd, intern = !verbose) :
running command 'D:/ProgramFiles/R-4.0.2/bin/x64/R CMD SHLIB file1f741c6e1040.cpp 2> file1f741c6e1040.cpp.err.txt' had status 1
3: In file(con, "r") :
cannot open file 'file1f741c6e1040.cpp.err.txt': No such file or directory
Error in sink(type = "output") : invalid connection
> setInternet2(TRUE)
Error: 'setInternet2' is defunct.
See help("Defunct")
解决方案
推荐阅读
- ios - 如何明智地裁剪图像形状?
- python - 根据 pandas 中的约束生成列
- node.js - Nodejs CRUD + 使用 Postman 进行测试
- c# - 在统一 C# 中从脚本执行 NGUI 按钮按下
- android - 我们可以从 WebApp 发出通知吗?
- javascript - 如何使用javascript验证输入是否为可读日期格式
- docker - Docker 将驱动程序和中间件安装到容器中
- amazon-web-services - AWS 每个项目是否提供免费套餐?
- clojure - Clojure 中带有映射的函数参数
- laravel - laravel 验证器未验证图像图像尺寸是否正确