Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Advanced Analytics with R and Tableau
Advanced Analytics with R and Tableau

Advanced Analytics with R and Tableau: Advanced analytics using data classification, unsupervised learning and data visualization

Arrow left icon
Profile Icon Roberto Rösler Profile Icon Jen Stirrup Profile Icon Ruben Oliva Ramos
Arrow right icon
€18.99 per month
Full star icon Half star icon Empty star icon Empty star icon Empty star icon 1.3 (7 Ratings)
Paperback Aug 2017 178 pages 1st Edition
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Roberto Rösler Profile Icon Jen Stirrup Profile Icon Ruben Oliva Ramos
Arrow right icon
€18.99 per month
Full star icon Half star icon Empty star icon Empty star icon Empty star icon 1.3 (7 Ratings)
Paperback Aug 2017 178 pages 1st Edition
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Advanced Analytics with R and Tableau

Chapter 1. Advanced Analytics with R and Tableau

Moving from data visualization into deeper, more advanced analytics? This book will intensify data skills for a data-savvy user who wants to move into analytics and data science in order to make a difference to their businesses, by harnessing the analytical power of R and the stunning visualization capabilities of Tableau.

Together, Tableau and R offer accessible analytics by allowing a combination of easy-to-use data visualization along with industry-standard, robust statistical computation. Readers will come across a wide range of machine learning algorithms and learn how descriptive, prescriptive, and predictive visually appealing analytical solutions can be designed solutions with R and Tableau.

Let's get ready to start our transition from being a data-savvy user to a data analyst using sound statistical tools to perform advanced analytics. To do this, we need to get the tools ready. In this topic, we will commence our journey of conducting Tableau analytics with the industry-standard, statistical prowess of R. As the first step on our journey, we will cover the installation of R, including key points about ensuring the right bitness before we start. In order to create R scripts easily, we will install RStudio for ease of use.

We need to get R and Tableau to communicate, and to achieve this communication, we will install and configure Rserve.

Installing R for Windows

The following steps shows how to download and install R on windows:

  1. The first step is to download your required version of R from the CRAN website [http://www.rproject.org/].
  2. Go to the official R website, which you can find at https://www.r-project.org/.
  3. The download link can be found on the left-hand side of the page.
  4. The next option is for you to choose the location of the server that holds R. The best option is to choose the mirror that is geographically closest to you. For example, if you are based in the UK, then you might choose the mirror that is located in Bristol.
  5. Once you click on the link, there is a section at the top of the page called Download and Install R. There is a different link for each operating system. To download the Windows-specific version of R, there is a link that specifies Download R for Windows. When you click on it, the download links will appear on the next page to download R.
  6. On the next page, there are a number of options, but it is easier to select the option that specifies install R for the first time.
  7. Finally, there is an option at the top of the page that allows you to download the latest R installation package. The install package is wrapped up in an EXE file, and both 32 bit and 64 bit options are wrapped up in the same file.

    Now that R is downloaded, the next step is to install R. The instructions are given here:

  8. Double-click on the R executable file, and select the language. In this example, we will use English. Choose your preferred language, and click OK to proceed:
    Installing R for Windows
  9. The Welcome page will appear, and you should click Next to continue:
    Installing R for Windows
  10. The next item is the general license agreement. Click Next to continue:
    Installing R for Windows
  11. The next step is to specify the destination location for R's files. In this example, the default is selected. Once the destination has been selected, click Next to proceed:
    Installing R for Windows
  12. In the next step, the components of R are configured. If you have a 32-bit machine, then you will need to select the 32-bit option from the drop-down list.
    Installing R for Windows
  13. In the next screenshot, the 64-bit User Installation option has been selected:
    Installing R for Windows
  14. The next option is to customize the startup options. Here, the default is selected. Click Next to continue.
    Installing R for Windows
  15. The next option is to select the Start Menu folder configuration. Select the default, and click Next:
    Installing R for Windows
  16. Next, it's possible to configure some of R's options, such as the creation of a desktop icon. Here, let's choose the default options and click Next:
    Installing R for Windows
  17. In the next step, the R files are copied to the computer. This step should only take a few moments:
    Installing R for Windows
  18. Finally, R is installed, and you should receive a final window. Click Finish:
    Installing R for Windows
  19. Once completed, launch RGui from the shortcut, or you can locate RGui.exe from your installation path. The default path for Windows is C:\Program Files\R\R- 2.15.1\bin\x64\Rgui.exe.
  20. Type help.start() at the R-Console prompt and press Enter. If you can see the help server page then you have successfully installed and configured your R package.

RStudio

The R interface is not particularly intuitive for beginners. For this reason, RStudio IDE, the desktop version, is an excellent option for interacting with R. The download and installation sequence is provided.

There are two versions; the RStudio Desktop version, and the paid RStudio Server version. In this book, we will focus on the RStudio Desktop IDE option, which is open source.

Prerequisites for RStudio installation

In this section, RStudio IDE is installed on the Windows 10 operating system:

  1. To download RStudio, you can retrieve it from https://www.rstudio.com/products/rstudio-desktop/.
  2. Once you have downloaded RStudio, double-click on the file to start the installation. This will display the RStudio Setup and Welcome page. Click Next to continue:
    Prerequisites for RStudio installation
  3. The next option allows the user to configure the installation location for RStudio. Here, the default option has been retained. If you do change the location, you can click Browse to select your preferred installation folder. Once you've selected your folder, click Next to continue to the next step.
    Prerequisites for RStudio installation
  4. In the next step, RStudio shortcuts are specified. Click on Install to proceed:
    Prerequisites for RStudio installation
  5. RStudio installs in the next step:
    Prerequisites for RStudio installation
  6. Once completed, launch RStudio IDE. You can find it by navigating to Start | All Programs | RStudio | RStudio.exe. Alternatively, you can type RStudio into the Cortana search box. If you specified a custom installation directory, then you can find RStudio as an EXE file. The default installation directory for RStudio IDE is C:\Program Files\RStudio\bin\rstudio.exe.
  7. Type help.start() at the RStudio prompt and press Enter. If you can see the help files on the screen then you have successfully installed and configured RStudio IDE to run with R.

Implementing the scripts for the book

Now that we have installed R and RStudio, we can download and install the scripts for this book. This book's scripts and code can be found on GitHub. If the reader hasn't got a free GitHub account, then it's recommended that Git and GitHub are set up. It's good practice for storing your own R scripts at a later date. If required, the reader is referred to the GitHub site for more details. GitHub itself can be found at github.com. Training material can be found at https://training.github.com/kit/.

After setting up Git and GitHub, you can download our data and scripts by taking a copy of this book's GitHub repository. Simply put, a fork is a copy of a repository, and it means that you can freely experiment with changes without affecting the original project. Please refer to the GitHub training material for more information on how to fork a repository, download data and scripts, and how to keep your local copy in sync with changes to the repository.

Tip

Go to the GitHub repo at https://github.com/datarelish/Advanced-AnalyticsRandTableauBook.

At the top right-hand corner of the page, click Fork. This means you have forked the repository. The next step is to download the files to your local computer. To do this, you can run the following line of code in your Git Bash:

Testing the scripting

Before we proceed, let's proceed to run a script to test that our setup works:

  1. Open the script in RStudio's script editor.
  2. Go to the Code menu item.
  3. Choose Source from the menu.
  4. Navigate to the Packt Tableau and R Book Setup.r file.
  5. Press Ctrl + A to select the whole script.
  6. In the script window, click Run.
  7. You should see the results in the output window.

Tableau and R connectivity using Rserve

Rserve is a server that allows applications to access R functionality. It allows you to use a series of functions to pass R expressions to an Rserve server and obtain a result.

If you upload a workbook that contains R functionality to the Tableau server, then the Tableau server must have a connection to an Rserve server. See R Connection, in the Tableau Desktop help, for details.

R is not supported for Tableau Reader or Tableau Online.

In this section, we will install, run, and configure Rserve.

Installing Rserve

To install and run Rserve, follow these steps:

  1. Open RStudio and go to the Install Packages tab on the interface.
  2. In the Packages textbox, type Rserve and click OK.
  3. Rserve will install, and you will see the output messages in the RStudio Console. When it is finished, you will see the chevron again.
  4. Now, open Control Panel on the server, and search for environment variable in the search box.
  5. Click on the Edit the System Environment Variables option.
  6. Add a new variable to the PATH variable path. Add the directory containing R.dll to your path environment variable. For example, C:\Program Files\R\R-3.0.2\bin\x64.
  7. You should see the new path in the Edit Environment Variable window. You can see a sample image here:
    Installing Rserve
  8. Click OK.

Let's check that Rserve is running properly:

In RStudio, let's call Rserve by running the following command in the RStudio Console:

library(Rserve)

Configuring an Rserve Connection

To configure an Rserve connection, follow these steps:

  1. On the Help menu in Tableau Desktop, choose Settings and Performance | Manage R Connection to open the Rserve connection dialog box.
  2. Enter or select a server name using a domain name or an IP address.
  3. Specify a port (Port 6311) is the default port for Rserve servers.
  4. If the server requires credentials, specify a username and password.
  5. Click Test Connection.
  6. Click OK.

Summary

In this chapter, we started on our journey of conducting Tableau analytics with the industry-standard, statistical prowess of R. In this chapter, we covered the installation of R, including a key point about ensuring the right bitness before we start. We also installed RStudio and ran a script, as a way of engaging with R. Finally, we installed and configured Rserve for Tableau.

In our next chapter, we will learn more about the underlying data structures of R so that we can make use of the analytic power of Tableau and R more effectively.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • A comprehensive guide that will bring out the creativity in you to visualize the results of complex calculations using Tableau and R
  • Combine Tableau analytics and visualization with the power of R using this step-by-step guide
  • Wondering how R can be used with Tableau? This book is your one-stop solution.

Description

Tableau and R offer accessible analytics by allowing a combination of easy-to-use data visualization along with industry-standard, robust statistical computation. Moving from data visualization into deeper, more advanced analytics? This book will intensify data skills for data viz-savvy users who want to move into analytics and data science in order to enhance their businesses by harnessing the analytical power of R and the stunning visualization capabilities of Tableau. Readers will come across a wide range of machine learning algorithms and learn how descriptive, prescriptive, predictive, and visually appealing analytical solutions can be designed with R and Tableau. In order to maximize learning, hands-on examples will ease the transition from being a data-savvy user to a data analyst using sound statistical tools to perform advanced analytics. By the end of this book, you will get to grips with advanced calculations in R and Tableau for analytics and prediction with the help of use cases and hands-on examples.

Who is this book for?

This book will appeal to Tableau users who want to go beyond the Tableau interface and deploy the full potential of Tableau, by using R to perform advanced analytics with Tableau. A basic familiarity with R is useful but not compulsory, as the book will start off with concrete examples of R and will move quickly into more advanced spheres of analytics using online data sources to support hands-on learning. Those R developers who want to integrate R in Tableau will also benefit from this book.

What you will learn

  • Integrate Tableau s analytics with the industry-standard, statistical prowess of R.
  • Make R function calls in Tableau, and visualize R functions with Tableau using RServe.
  • Use the CRISP-DM methodology to create a roadmap for analytics investigations.
  • Implement various supervised and unsupervised learning algorithms in R to return values to Tableau.
  • Make quick, cogent, and data-driven decisions for your business using advanced analytical techniques such as forecasting, predictions, association rules, clustering, classification, and other advanced Tableau/R calculated field functions.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 22, 2017
Length: 178 pages
Edition : 1st
Language : English
ISBN-13 : 9781786460110
Vendor :
Tableau
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Aug 22, 2017
Length: 178 pages
Edition : 1st
Language : English
ISBN-13 : 9781786460110
Vendor :
Tableau
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 120.97
Learning Tableau 10
€45.99
Mastering Tableau
€41.99
Advanced Analytics with R and Tableau
€32.99
Total 120.97 Stars icon
Banner background image

Table of Contents

9 Chapters
1. Advanced Analytics with R and Tableau Chevron down icon Chevron up icon
2. The Power of R Chevron down icon Chevron up icon
3. A Methodology for Advanced Analytics Using Tableau and R Chevron down icon Chevron up icon
4. Prediction with R and Tableau Using Regression Chevron down icon Chevron up icon
5. Classifying Data with Tableau Chevron down icon Chevron up icon
6. Advanced Analytics Using Clustering Chevron down icon Chevron up icon
7. Advanced Analytics with Unsupervised Learning Chevron down icon Chevron up icon
8. Interpreting Your Results for Your Audience Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Half star icon Empty star icon Empty star icon Empty star icon 1.3
(7 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 28.6%
1 star 71.4%
Filter icon Filter
Top Reviews

Filter reviews by




GP_user Nov 14, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
I used this book for a training. Seems that author or the editors could have spent more time before publishing this book. Texts and codes don’t always match and codes are not even consistent. Best part is on page 124, data was about flower iris, but middle in the page it reads ‘wine’ from some unknown data. You can’t help but thinking how nice it must have been thinking of flowers and wines while writing this part!
Amazon Verified review Amazon
NJ Reader Oct 30, 2017
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Overall, the book is a fantastic overview of using R in tableau. The issue is that you cannot get your hands on the files to go along with the book. In the beginning, they have you going to Packt Publishing and/or Git Hub to get them, but when you do, there are only "read me" files and the CSV data you should have is nowhere to be found.. I contacted Packt and they sent me two emails, telling me that were trying to reach the author. The problem is that I wanted the files in order to teach classes with them. I would have given five stars to the book, if I had the files. But, as is, my students cannot use the book in the way the author says they can.
Amazon Verified review Amazon
Ray Prtha Aug 02, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
This book contains pages and pages of theory with very little practical execution or hands-on exercises. Totally useless. It is like reading a book on swimming when what you really want to do is actually swim.
Amazon Verified review Amazon
Tim Terry Feb 27, 2019
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I don't ever want to write a negative review for a book. However, in this case, it seems warranted. The text of the e-book seems to be incomplete. The chapter summaries read as if large parts of chapters are missing. The packet of supporting files are very confusing. The sample Tableau files are missing the associated databases and have nothing to do with the chapters. I thought maybe the file set was wrong, but the databases are the correct ones. The R examples seem to be well done, but the Tableau examples are pretty poorly documented. I was hoping for a book that talked about integration of R and Tableau more. Perhaps this book does, within the missing sections, but as is, it was not 40 dollars well spent. I'm very dissatisfied.
Amazon Verified review Amazon
Huy Jan 02, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
This book has a lot of useful informations if and only if the data they use is not broken/changed.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.