r - 从 Rprofile.site 启动 Rserve

标签 r linux rserve

<分区>

我想使用如下所示的 Rprofile.site 启动 Rserve

 .First <- function(){
    library(Rserve)
    Rserve(args="--RS-conf /usr/lib64/R/etc/Rserv.conf")
    source("/usr/lib64/R/etc/InvestorToolBox.R")
    }

但是出于某些原因,当我运行 R 时,它会进入一个循环,在该循环中它继续运行 Rserve 实例,如屏幕截图所示

Starting Rserve: /usr/lib64/R/bin/R CMD /usr/lib64/R/library/Rserve/libs//Rserve --RS->conf /usr/lib64/R/etc/ Rserv.conf

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

Starting Rserve: /usr/lib64/R/bin/R CMD /usr/lib64/R/library/Rserve/libs//Rserve --RS->conf /usr/lib64/R/etc/ Rserv.conf

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

Starting Rserve: /usr/lib64/R/bin/R CMD /usr/lib64/R/library/Rserve/libs//Rserve --RS-

conf /usr/lib64/R/etc/ Rserv.conf

你能告诉我为什么或我做错了什么吗?

最佳答案

编辑: tl;dr 是你做错了。通过在 ~/.Rprofile 中启动,您将获得一个 R 进程,该进程读取 ~/.Rprofile 并启动......您将获得自己的递归。简单的解决方法是按应有的方式使用 Rserve

人们倾向于在 R 之外启动 Rserve:

edd@max:~$ R CMD Rserve 

R version 3.3.0 (2016-05-03) -- "Supposedly Educational"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Rserv started in daemon mode.
edd@max:~$ pstree -p | grep Rserve
           |-Rserve(24569)
edd@max:~$ 

RServe 有一些选项可以使用其特定的配置文件来设置特定的启动参数、身份验证选择等 pp

关于r - 从 Rprofile.site 启动 Rserve,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37323657/

相关文章:

r - 如何从命令行关闭 Rserve

r - 不使用 Google API 从地址获取纬度和经度

java - Eclipse 无法识别 Debian/Linux 上的 Apache Tomcat

regex - 如何在 bash 脚本中存储 "time"函数输出的子字符串

linux - bash 中是否有命令获取前 n 个单词而不是类似于 'head -n' 的 n 行?

r - 使用终端将参数传递给 Rserve

r - 使用插入符号进行生存分析(随机生存林)

r - 在没有 Rcpp 的情况下加快速度?

r - 将列名转换为行值并求和

java - 并行处理上的 Rserve/R 堆栈