gsk
gsk

Reputation: 31

Loading SparkR within RStudio: Err [could not find function "launchBackend"]

Having trouble loading SparkR into my RStudio. When I try to load a spark context, I get the error:

Could not find function "launchBackend."

I can get sparkR working on my terminal shell, but that's also because I don't have to load a spark context (it seems like it's already there). Any help?

Sys.setenv(SPARK_HOME="~/spark-1.4.1")
.libPaths(c(file.path(Sys.getenv("SPARK_HOME"), "R", "lib"), .libPaths()))
library(SparkR)
sc <- sparkR.init(master = "local")
sqlContext <- sparkRSQL.init(sc)

Upvotes: 3

Views: 1330

Answers (1)

xyzzy
xyzzy

Reputation: 329

One thing which might help is to type the full path in. R doesn't expand the tilde.

Instead of:

Sys.setenv(SPARK_HOME="~/spark-1.4.1")

Something like this:

Sys.setenv(SPARK_HOME="/home/spark-1.4.1")

Upvotes: 4

Related Questions