Fuzzy Logix’s new R package AdapteR enables the R syntax to consume DB Lytix™ in-database analytics by generating SQL transparently, and replacing R matrix and data frame data structures with remote table objects.
With Fuzzy Logix’ DB Lytix™, advanced analytics can realize dramatic improvements in performance by moving computation from client machines into data warehouses and clusters where big data lives. As important as performance and scalability is the way in which the end user interacts with the analytics, and the R language has become most pervasive in this area. R is remarkably expressive and flexible, allowing for fast prototyping and evaluation, enabling agile analytics. Fuzzy Logix’s new R package AdapteR enables the R syntax to consume DB Lytix™ in-database analytics by generating SQL transparently, and replacing R matrix and data frame data structures with remote table objects. AdapteR uses R’s class system and method override to seamlessly leverage in-database analytics, without requiring complicated R server installations or writing custom SQL. AdapteR can be used to build interactive analytics at scale with just a few lines of R code!
You can download the full manual here: AdapteR package manual.
AdapteR needs DB Lytix™ suite to be installed on your Teradata Appliance, so it can use its fast C++ implementation of analytical functions. Find more information on http://www.fuzzylogix.com.
- Download and install R(>=3.2.0) from https://cran.r-project.org/bin/windows/base/
- Install R using
Ubuntu:
apt-get install r-base
- Install OS packages required to build R packages
Ubuntu:
apt-get -y build-dep libcurl4-gnutls-dev apt-get -y install libcurl4-gnutls-dev apt-get install libssl-dev
We recommend to
- add R and Rcript executables to PATH variable.
- install R-Studio: https://www.rstudio.com/products/rstudio/download/
- Open R-Studio or an R terminal
- The recommended way to install (or update) the package is through github and the convenience function
install_github
function in thedevtools
package:- Install devtools package using “install.packages(“devtools”)”
install.packages("devtools") ## Required for install_github
- Load devtools using
require(devtools)
- Install AdapteR from github
install_github("Fuzzy-Logix/AdapteR")
This automatically installs dependencies.
- Install devtools package using “install.packages(“devtools”)”
- Load AdapteR using
library(AdapteR)
remove.packages("AdapteR")
Use flConnect
to connect to a database. Help on this can be found using
?flConnect
install.packages("RODBC") ## Required for ODBC Connection.Need to setup odbc Source
library(RODBC)
- Windows:
- (re-)install the jdk, and set the path variable in R
Sys.setenv(JAVA_HOME="yourPathTojdk")
(https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/)
- Linux:
- install jdk and sources
Ubuntu:
sudo apt install default-jdk
- setup R for using your java installation
sudo R CMD javareconf
- install jdk and sources
Ubuntu:
In order to use jdbc with AdapteR, you need to install rJava
install.packages("rJava") ## Required for RJDBC
install.packages("RJDBC") ## Required for JDBC connection
library(RJDBC) ## check if RJDBC can be loaded
Also, you need to download and use the jdbc connector jar files either in the java load path or provide them when calling flConnect
the java development toolkit (jdbc).
The package includes some demos to get you started and to explain the most important concepts:
require(AdapteR)
demo(package="AdapteR")
## run a demo:
## demo("matrix.correlation",package="AdapteR")
Demos in package ‘AdapteR’: connecting matrix.algebra matrix.correlationThe following suggested packages provide functions that are used if AdapteR functions are called on data.frame, matrix or vectors (not remote representations). Functions in these packages provide the reference implementations for
install.packages("psych")
install.packages("SDMTools")
install.packages("MASS")
install.packages("psych")
install.packages("cluster")
install.packages("survival")
install.packages("mgcv")
install.packages("moments")
install.packages("stringdist")
These packages are required to run the test suite:
install.packages("testthat")
install.packages("optparse")