Tableau - R Integration


Introduction

Tableau can pass calculations to R to extend the functionality, but there is some setup involved. 

R is a popular statistical language used to perform sophisticated statistical analysis and predictive analytics, such as linear and nonlinear modeling, statistical tests, time-series analysis, classification, clustering, etc.

  • To develop content you will need to set up your own RServe to point Tableau Desktop at.
  • When you publish content to the Tableau Server it will use its own RServe.
  • The RServe instance that Tableau Server utilizes is not approved for PHI.

Instructions

What is R? (from the Using R and Tableau whitepaper)

R is a popular statistical language used to perform sophisticated statistical analysis and predictive analytics, such as linear and nonlinear modeling, statistical tests, time-series analysis, classification, clustering, etc.

 

The R-console primarily utilizes a command-line interface, but there are many GUI tools available for download to make it easier to write R programs (most of them are free). With R, users can create variables, formulas, functions, and graphs to visualize their analysis and predictions.

 

As a free, open-source language, there is a community of contributors who continually create new packages (extensions) for R that define advanced statistical functions that were not originally built into R. These packages can be downloaded into R to expand R's capabilities. Most of these packages are also developed and made available for free. It is for this reason that R has become so popular and why it continues to gain functionality over time.

How Can I Get Started?

To learn more about R and if it is something you should use Tableau has a good whitepaper on the subject. There are lots of great tutorials online for R and using it with Tableau. A good roundup of them is available here.

 

Using R isn't easy or straightforward since you will need to set up your own RServe instance to point Tableau Desktop at. The articles linked above cover how to do that. 

R Packages

Most of the magic in using R comes from the available packages. Below is a list of packages If you need additional packages installed for the Tableau Server to use please create a ServiceNow ticket and have it assigned to the Analytics and Business Intelligence group.

 

Package Link Comments Date Added
broom https://cran.r-project.org/web/packages/broom/index.html   Initial Build
dbplyr https://cran.r-project.org/web/packages/dbplyr/index.html   Initial Build
dbi https://cran.r-project.org/web/packages/DBI/index.html   Initial Build
Sqldf http://cran.r-project.org/web/packages/sqldf/index.html   Initial Build
Forecast http://cran.r-project.org/web/packages/forecast/index.html   Initial Build
qcc http://cran.r-project.org/web/packages/qcc/index.html   Initial Build
tidyverse https://www.tidyverse.org/packages/ core includes ggplot2, dplyr, tidyr, readr, purrr, tibble, stringr, forecats Initial Build
lubridate http://www.r-statistics.com/2012/03/do-more-with-dates-and-times-in-r-with-lubridate-1-1-0/   Initial Build
broom https://cran.r-project.org/web/packages/broom/index.html   Initial Build
dbplyr https://cran.r-project.org/web/packages/dbplyr/index.html   Initial Build
reshape2 https://cran.r-project.org/web/packages/reshape2/index.html   Initial Build
keyring https://cran.r-project.org/web/packages/keyring/index.html   Initial Build
lwgeom https://cran.r-project.org/web/packages/lwgeom/index.html   Initial Build
sp https://cran.rstudio.com/web/packages/sp   Initial Build
maptools http://www.rdocumentation.org/packages/maptools   Initial Build
esri2sf https://github.com/yonghah/esri2sf   Initial Build
maps http://www.rdocumentation.org/packages/maps   Initial Build
ggmap http://journal.r-project.org/archive/2013-1/kahle-wickham.pdf   Initial Build
zoo https://cran.rstudio.com/web/packages/zoo   Initial Build
xts https://cran.rstudio.com/web/packages/xts   Initial Build
wuantmod http://www.quantmod.com   Initial Build
car http://www.rdocumentation.org/packages/car   Initial Build
tidygraph https://cran.r-project.org/web/packages/tidygraph/index.html   Initial Build
MonteCarlo https://cran.r-project.org/package=MonteCarlo   Initial Build
httr https://www.rdocumentation.org/packages/httr/versions/1.3.1/topics/httr-package   Initial Build
jsonlite https://cran.rstudio.com/web/packages/jsonlite/   Initial Build
mgcv http://www.rdocumentation.org/packages/mgcv/functions/mgcv-package   Initial Build
lme4 http://www.rdocumentation.org/packages/lme4/functions/lme4-package   Initial Build
nlme http://www.rdocumentation.org/packages/nlme/functions/nlme   Initial Build
randomForest http://www.rdocumentation.org/packages/randomForest/functions/randomForest   Initial Build
multcomp http://www.rdocumentation.org/packages/multcomp   Initial Build
vcd http://www.rdocumentation.org/packages/glmnet/functions/glmnet   Initial Build
glmnet http://www.rdocumentation.org/packages/glmnet/functions/glmnet   Initial Build
survival http://www.rdocumentation.org/packages/survival   Initial Build
caret https://cran.rstudio.com/web/packages/caret   Initial Build
cpm https://cran.r-project.org/web/packages/cpm/index.html   11/15/18
tidytext https://cran.r-project.org/web/packages/tidytext/index.html    10/28/2020
ca https://cran.r-project.org/web/packages/ca/index.html    10/28/2020
syuzhet https://cran.r-project.org/web/packages/syuzhet/index.html    10/28/2020
irr https://cran.r-project.org/web/packages/irr/index.html   2/11/2021
lpSolve https://cran.r-project.org/web/packages/lpSolve/index.html   2/11/2021