6

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
Ganesh Bhat
  • 295
  • 7
  • 20

2 Answers2

4

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).
sunny
  • 51
  • 2
  • 8
1

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.

ChrisP
  • 119
  • 1
  • 8
  • How do I move to an earlier version of R? Currently have 3.2 installed in which I am getting the error. – Ganesh Bhat Apr 26 '15 at 04:55
  • You should be able to install it from [link](http://cran.rstudio.com/) and select an earlier version from "Source code of older versions of R is available here.". You'll probably need to install `devtools` again in order to install packages from github. As I said, I tried R v3.1.2 and it worked for the `pander` package but not for `sparkr`, but R v3.1.3 may work for `sparkr`. – ChrisP Apr 27 '15 at 12:38
  • @ChrisP that sounds really strange. Can you please give some more details on that `pander` issue? I'm the maintainer and would love to understand what went wrong on your machine. Please submit a ticket on GitHub if you think it's something with the package: https://github.com/Rapporter/pander/issues – daroczig May 16 '15 at 07:36
  • @daroczig - I had the same error message as @GaneshBhat. I'm fairly sure it wasn't a problem with `pander`. The problem was only when installing `pander` from Github, not CRAN. For your reference I was running devtools v1.7.0, Windows 7, R v3.2.0 and RStudio v0.99.386 (same problem in earlier verisons of Rstudio and R). – ChrisP May 18 '15 at 12:38