forked from JonRoussot/spark-and-r-with-sparklyr-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallspark.R
35 lines (21 loc) · 1.02 KB
/
installspark.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Pre-installation script for Intermediate R Programming / Spark and R with Sparklyr
# General -----------------------------------------------------------------
install.packages(c("mangoTraining", "tidyverse"))
# Intermediate R ----------------------------------------------------------
install.packages(c("profvis", "microbenchmark"))
# Sparklyr ----------------------------------------------------------------
install.packages("sparklyr")
library(sparklyr)
library(dplyr)
# The sparklyr package contains a function that installs Spark:
# spark_install()
# Spark 2.4.3 for Hadoop 2.7 or later already installed.
# After installing spark you may need to restart your R session.
# After restarting try to execute the following code to verify Spark is working.
sc <- spark_connect(master = "local")
# Check the console for errors.
copy_to(sc, iris)
# Check the console for errors.
spark_disconnect_all()
# Please also download all of the data files from GitHub:
# https://github.com/MangoTheCat/spark-and-r-with-sparklyr-course