How to connect to Analytics for Hadoop BigR from local RStudio
Install R 3.1.2 for windows either 32 bit or 64 bit pertaining to your environment. R is a system for statistical computation and graphics. It consists of a language plus a run-time environment with graphics, a debugger, access to certain system functions, and the ability to run programs stored in script files.
R can be downloaded from http://cran.r-project.org/bin/windows/base/
RStudio is a set of integrated tools designed to help you be more productive with R. It includes a console, syntax-highlighting editor that supports direct code execution, as well as tools for plotting, history, debugging and workspace management. RStudio requires R 2.11.1 (or higher) to run.
Download RStudio from here :
Open RStudio, install the 3 prerequisite packages for installing bigR – base64enc, rJava, data.table from the cran repositories. RStudio → Tools-> Install Packages. Select Install from cran repository and provide the package name as shown below.
- Install bigR package in RStudio. Tools → Install Packages → Install from Archive. Input the downloaded bigr-1.0.tar.gz in the package archive text field and click on Install.
Once bigR is installed, you should see this message in RStudio
> install.packages("C:/Downloads/R/bigr-1.0.tar.gz", repos = NULL, type = "source")
* installing *source* package 'bigr' ...
** preparing package for lazy loading
Attaching...Creating a generic function for 'toString' from package 'base' in package 'bigr'
Creating a generic function for 'nchar' from package 'base' in package 'bigr'
Creating a generic function for 'coef' from package 'stats' in package 'bigr'
Creating a generic function for 'predict' from package 'stats' in package 'bigr'
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (bigr)
- Connect to bigR on bluemix a4H cluster and run your bigR queries
> bigr.connect(host="bi-hadoop-prod-253.services.dal.bluemix.net", 7052, "default", user="biblumix", password="biblumixpassword")
Some Tips :
1. Make sure Oracle Java 7 is set in your JAVA_HOME and path. This is required while installing the packages.
2. If your Rstudio does not start, please see the Rstudio Troubleshooting Guide.
3. Once SGC is activated on your A4H service, you can run your ML queries from Rstudio.