-
-
Save tomz/5b98f3f9f74131edafe6 to your computer and use it in GitHub Desktop.
Rstudio local setup
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
Sys.setenv(SPARK_HOME="/Users/shivaram/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) | |
df <- createDataFrame(sqlContext, faithful) | |
# Select one column | |
head(select(df, df$eruptions)) | |
# Filter out rows | |
head(filter(df, df$waiting < 50)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment