segunda-feira, 10 de outubro de 2016

Install Spark in RStudio

Hello everyone, today I will be sharing my experience of installing the Spark tool to R when downloading it from the website

1) Go to the Spark website and download the latest version

2) Put the downloaded file in the place you want (for example your home folder, etc)

3) The R library should be in  /R/lib/SparkR/ (inside your spark folder)

4) Set the environment variable of R:
4.1) To check the environment variable, you need to use the command: Sys.getenv()
4.2) Then use the command to set set the environment variable in R studio: Sys.setenv(SPARK_HOME='/YOUR_PATH_TO_SPARK')
.libPaths(c(file.path(Sys.getenv('SPARK_HOME'), 'R', 'lib'), .libPaths()))
Done!

Using Spark

To use spark you simply have to call library(SparkR) as you would do with any other normal libraries



Nenhum comentário:

Postar um comentário