Connecting to SAS, SPSS, and R files
In this recipe, we'll connect to a statistical file. Tableau Prep offers fantastic integration with popular statistical files from SAS (.sas7bdat), SPSS (.sav), and R (.rdata, .rda).
I advocate the use of open file formats such as CSV or commonly used standards such as Excel. However, if you are unable to obtain your data in such a format from your data science partner, this connector may offer a solution.
Getting ready
In this recipe, we'll connect to an R file using the statistical file connector. In order to follow along, download the Sample Files 2.3 folder from the book's GitHub repository.
How to do it…
To get started, ensure you have the sample RData file available on your computer. From the Tableau Prep home screen follow these steps:
- Click the Connect to Data button and select Statistical file.
- From the browse file window, locate and open our statistical file named December 2016 Sales.Rdata.
And with just these few steps, Tableau Prep Builder has added the statistical file source to a new flow:
Most options in the bottom pane are identical to those when processing Excel files. However, there is a small but important feature absent. You cannot alter the data type of the fields in the statistical file connection step. In order to do this, you have to use a cleaning step, which we'll discuss in Chapter 3, Cleaning Transformations:
In this recipe, you have learned how to add Tableau Prep to a data science workflow by connecting to data produced by popular statistics applications.
How it works…
Tableau Prep unpacks statistical files when you connect to them and, from that moment on, allows you to leverage them like any other connection.
There's more…
There are some limitations when it comes to connecting to statistical files. If you run into any connection issues, I recommend you refer to the following section of the Tableau documentation online: https://help.tableau.com/current/pro/desktop/en-us/examples_statfile.htm.