To install and launch R and Rserve, follow the below step of instructions for your Operating System. 

Installing R on Windows OS

The Windows version of Rserve supports only one connection at a time. Any subsequent connections to the same Rserve share the same working directory and data space. In order to have multiple users share a single R instance, you should consider running Rserve on Linux or OS X platforms. These platforms don't have the single connection limitation. You can find more information at this link: https://rforge.net/Rserve/doc.html


Downloading the Installation Package for Windows
1. Go to http://cran.r-project.org/bin/windows/base and download the current version of R for Windows. [R-3.2.2-win.exe  [62.5 MB]]
At the time of documentation, current version available is: R - 3.2.2
 
2. Run the downloaded executable to install the R package.
 
3. Open the R console window— by choosing R > Rx64 3.2.2 from the Start menu.
 
Enter 'help()' for on-line help, or 'help.start()' for an HTML browser interface for help. Type 'demo()' for some demos and 'q()' to quit R.
 
Installing Rserve
 

  1. In the R console, type command:

    install.packages("Rserve").

    -  Windows will prompt for permission to create folder in R installation directory for packages download. Select Yes.


     
  2. When prompted to select a CRAN mirror, select a location near you.


     
  3. Note the location to which the package has been downloaded.
     
  4. Unzip the Rserve package ("Extract all files."). Explore it, It has folder named ‘Rserve’.


     
  5. Copy- Paste the Rserve directory to Path- containing R.dll file.

    For example , R.dll file location - C:\Program Files\R\R-3.2.2\bin\x64


Launching and Running Rserve
 
Steps to run Rserve –
1. First open an R console window—for example, by choosing R > Rx64 3.2.2 from the Start menu,
 
2. To run Rserve from the R Console on a Windows computer, enter the following 4  commands
 
          setwd("C:/Program Files/R/R-3.2.2/bin/x64")
          library(Rserve)  
          Rserve()
          Rserve(args = "--vanilla --RS-enable-remote")

 
 


Installing R on Ubuntu OS

Downloading the Installation Package
1. Open a new Terminal window and run the below command to download latest version of R and Rserve:
 
         sudo apt-get install r-base r-base-dev r-cran-rserve
 

 
2. Once the installation process is complete, open R from Ubuntu Finder and it opens in a terminal. You can also type sudo R in a terminal to start up R in Ubuntu.

 
Launching and Running Rserve
 
1. Type Below command to launch Rserve from within R
         library(Rserve)
         Rserve()

 
Once Rserve is successfully started, you can see the below notification that Rserve started in daemon mode.
 

 


Installing R on Mac OS X

Downloading the Installation Package

  1. Navigate to https://cran.r-project.org/bin/macosx/ and download the current version of R for Mac. [R-3.2.2.pkg  [69 MB] at the time of documenting this article].
     
  2. Double click on this file and install R.


Launch R in Mac OSX:
 

  1. Once you have installed R, open a  command line to launch R. Type R and you can see the R version followed by the R prompt which accepts R commands. See below screenshot of R version 3.2.2 installed on OSX 10.8.5
     
  2. One more way to open a minimal GUI for R in OSX, is to type in R.app in the Spotlight global search that brings up the R application. To open Spotlight, click the magnifying glass icon in the upper-right corner of the menu bar and enter R.app

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

 

 
 
Running Rserve from the R console on MAC OSX 
 

  1. To Install Rserve navigate to https://rforge.net/Rserve/files/ and download Rserve snapshot [Rserve_1.8-4.tar.gz 486KB].
     
  2. With MAC OSX, you would need to set the working directory for R using the setwd command, followed by the library(Rserve) and Rserve(args = "--no-save") commands.


    setwd("/Users/tariq/R/R-3.2.2/bin/x64")
    library(Rserve)
    Rserve(args = "--no-save")


Installing Rserve and using a command line to open Rserve:
 

  1. To Install Rserve navigate to https://rforge.net/Rserve/files/ and download Rserve snapshot [Rserve_1.8-4.tar.gz 486KB].
     
  2. Open a terminal window and navigate to the directory containing the downloaded Rserve file. Type below command to install Rserve package.

    R CMD INSTALL <RServe FileName>
    Eg.   R CMD INSTALL  Rserve_1.8-4.tar.gz

 
Launching and Running Rserve from command line:
 
Rserve is a stand-alone program, so it can be started directly as well. If you installed Rserve from a source package (on unix), type: R CMD Rserve
 

  1. Execute below command to start R with Rserve package:
    R CMD Rserve



  • No labels