从 dos 终端调用 R help(...) 命令
我想从 dos 终端调用 R-help。我的尝试包括:
R.exe -e "help(matrix)"
Rscript.exe -e "help(matrix)"
等。
结果都是一样的,资源管理器打开但没有找到该文件。 dos 终端没有显示任何错误,仅显示:
> help('matrix')
starting httpd help server ... done
但是,使用 Rgui,help(matrix) 命令工作正常,这让我相信 httpd 帮助服务器出现故障。有什么想法吗?
I want to invoke R-help from the dos terminal. My attempts include:
R.exe -e "help(matrix)"
Rscript.exe -e "help(matrix)"
etc.
The results are all the same, explorer opens but does not find the file. The dos terminal shows no error, only:
> help('matrix')
starting httpd help server ... done
However, with Rgui, the help(matrix) commands works fine, which lends me to believe that the httpd help server is failing. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是运行 httpd 服务器的 R 进程在有机会提供内容之前终止。
您需要找到一种方法来保持 R 进程处于活动状态,直到它满足您的需要,或者在服务/守护进程模式下运行 R httpd 服务器(如果实际上可能的话)。
例如,以下内容将使 R 进程保持活动时间更长一点,以便它可以完成处理 http 请求:
我找不到一种明显的方法来让 R httpd 服务器作为服务/守护进程运行,但我不是真是个专家。也许其他人会知道该怎么做。
The problem is that the R process that runs the httpd server terminates before it has a chance to serve up the content.
You'd need to find a way to keep the R process alive until it had served what you need, or run the R httpd server in service/daemon mode, if that is in fact possible.
For example, the following will keep the R process alive a little longer so that it can finish handling the http request:
I can't find an abvious way to get the R httpd server running as a service/daemon, but I'm not really an expert. Perhaps someone else will know how to do it.