Embedding R code in a Tableau Prep flow
In the previous recipe, you learned how to configure your machine with R. You also set up a connection from Tableau Prep to R, using the Rserve package. In this recipe, we'll leverage that foundational setup to run an R script using Tableau Prep. We'll learn how to embed a script in our flow and understand how R sends the data back to our Tableau Prep data flow. The examples used are simple but form a solid foundation. Once you have mastered the basics, you'll be able to implement more advanced scripts, such as the script in the recipe titled Forecasting time series using R.
Getting ready
To follow along with this recipe, download the Sample Files 8.2 folder from this book's GitHub repository.
Important note
R is a programming language of its own, not covered by this book. We'll look at R code in this recipe at a very high level only, so you will gain sufficient knowledge to integrate R with Tableau Prep...