Basic Proof of Concept: Save an R dataframe as a Tableau Data Extract

July 30, 2013

(This article was first published on Data Twirling » R, and kindly contributed to R-bloggers)

I love Tableau, as it is a huge part of my data workflow. Not only is it super easy to slice and dice data, but the company recently released an API for developers.  In short, we can use a few languages (python and C++/Java) to build Data Extracts, the super fast back-end that makes using Tableau on large data-sets a breeze.

With that said, it would have been nice to have an API for R.  I am not the only person who wants to see this.

As noted in my Github Repo, my ideal workflow would allow me to save an R DataFrame as a Tableau Data extract.  This way, I could do  a lot of the heavy lifting (data cleaning, recodes, modeling) in R prior to my reporting in Tableau.

In the end, I am sure its possible for someone with C++ skills to write an R package, but my skills are not there just yet.

The ipython notebook represents a very crude and naive way to get data from R into a Tableau Data Extract.  To follow along:

  1. Clone the repo
  2. Run the code in Model-in-R.R.  This will save an R data file in your current directory
  3. Fire up ipython notebook in the same directory
  4. Run the code

I am trying to grow my skills in my python, so I make no claims that the code presented in the repo is elegant or free of bugs.  Also, it requires the rpy2 package for python, which admittedly, was a pain to get up and running on windows.

Lastly, it’s worth noting that one major limitation (and oversight) in my eyes is that Tableau only works on Windows.  It seems like the API requries the .dll files that are installed with the software.  While the option of an API is awesome, I have to believe that the majority of developers that would leverage this option are not writing code in a Windows environment.


To leave a comment for the author, please follow the link and comment on their blog: Data Twirling » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training




CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)