Where is the Rserve Config file located on Windows?

為{幸葍}努か 提交于 2019-12-03 09:10:11

Rserve does not automatically come with a config file, you must make one. Best steps for doing so:

  1. Navigate to the file where you just installed Rserve.exe (C:\R\R-31~1.0\library\Rserve\libs\x64\R, based on the message you copied here)
  2. Find Rserve.exe, Reserve_d.exe, and Rserve.dll there. Copy these files.
  3. Navigate to where R.dll is on your computer. This is probably C:\Program Files\R\R-3.1.3\bin\x64, but may be different depending on where you installed R to.
  4. Copy the 3 files mentioned above to this location.
  5. Create a text file here named "Rserv.cfg" with the arguments you are looking for, such as port 6312 or library(mvoutlier). Yes, I know that this is different from the documentation, but if you start Rserve_d.exe you will see that this is the file it is looking for. I have not had success naming it anything else.

You can start Rserve by specifying the location of the config file. In R instead of just Rserve() try the following:

Rserve(args="--RS-conf C:\\folder\\Rserv.cfg")

If path is more complicated you need to massage it a little bit:

Rserve(args="--RS-conf C:\\PROGRA~1\\R\\R-215~1.2\\library\\Rserve\\Rserv.cfg")

Look in the $RHOME/bin directory

If you can't find it here is a different way to approach it:

  1. Download Rserve at [http://rforge.net/snapshot/Rserve_.tar.gz], and save it in your desired directory
  2. Run R CMD INSTALL Rserve_.tar.gz

This allows you to leave Rserve where you want it.

After looking at the Rserve source code and making some test I found that on Windows platform Rserve try to load the configuration file from the current working directory. Also pay attention because on Windows the file name is RServ.cfg and not Rserv.conf as documented.

The current working directory depends of the process, for example using RStudio by default it is your Documents and Settings folder:

C:\Users\[username]\Documents

but can be changed in the "Global Options" of the IDE

So you can create an "RServ.cfg" text file in that directory with your needed options and starting RServe in the usual way in RStudio

Rserve()

will load your configuration.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!