Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing Apache SparkR package

I am getting the following error while installing the apache sparkr package:

install_github("amplab-extras/SparkR-pkg", subdir="pkg")
Downloading github repo amplab-extras/SparkR-pkg@master
Installing SparkR
Error in isNamespaceLoaded(pkg) : 
 attempt to use zero-length variable name
like image 210
Ganesh Bhat Avatar asked Apr 21 '15 10:04

Ganesh Bhat


2 Answers

I was able to load the SparkR library in R/RStudio by doing the following:

Download and setup SparkR
1. Download spark-1.4.0 and untar/unzip it
2. Install spark, then go to your directory /spark01.4.0/R
3. In a terminal, run ./install-dev.sh. This will create a folder called "lib" in your directory

Add SparkR to R .libPaths()
4. In a terminal:

    cat >> $HOME/.Rprofile <<EOT
    lib_path <- .libPaths()
    lib_path <- c(lib_path,"/MyDirectory/spark-1.4.0/R/lib")
    .libPaths(lib_path)
    rm(lib_path)
    EOT
  1. Load R, then use library(SparkR).
like image 149
sunny Avatar answered Oct 22 '22 14:10

sunny


I've been having the same problem with the pander package and managed a long-winded work around. I installed pander from Github to an earlier version of R (3.1.2 worked for me). I then copied across the package from \library\pander into my new R v3.2.0 installation. So far it seems to be working fine.

I've had a go at doing this for the sparkr package, but unfortunately it requires a more recent build of R. You might find that R v3.1.3 will work, but I'm not able to test that on my machine.

like image 45
ChrisP Avatar answered Oct 22 '22 15:10

ChrisP