Last active
August 29, 2015 14:24
-
-
Save akiatoji/5b516a25ab3af6b3f5c8 to your computer and use it in GitHub Desktop.
Loading and using SparkR, OSX Homebrew Spark 1.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SparkR RULES! | |
#Load libraries | |
library("rJava") | |
library(SparkR, lib.loc="/usr/local/Cellar/apache-spark/1.4.0/libexec/R/lib") | |
sc <- sparkR.init(sparkHome = "/usr/local/Cellar/apache-spark/1.4.0/libexec") | |
sqc <- sparkRSQL.init(sc) | |
# Create SparkR dataframe from R dataframe | |
df <- createDataFrame(sqc, faithful) | |
head(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment