-
-
Save dwerbam/ca1ec677f06b6fb66b8a to your computer and use it in GitHub Desktop.
Rstudio local setup
This file contains hidden or 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