Setting up Spark and SparkR is quite easy (assume you are running v.1.4): just grab one of the pre-built binaries and unzip to a folder. There is also a shell script to start SparkR from command line. The document suggest to put the following lines
.libPaths(c(file.path(Sys.getenv(“SPARK_HOME”), “R”, “lib”), .libPaths()))
sc <- sparkR.init(master="local")
into the .Rprofile file. This, however, has the undesirable side effect of adding yet another directory to which R packages can be installed.
My solution is:
1. Create a soft link of the SparkR directory in the the directory where other R packages are installed (ln -s /home/shige/bin/spark/R/lib/
2. Add only one line (Sys.setenv(SPARK_HOME=”/home/shige/bin/spark”)) to the .Rprofile file.