Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
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

By Ruben Oliva Ramos , Jen Stirrup , Roberto Rösler
$43.99
Book Aug 2017 178 pages 1st Edition
eBook
$35.99 $24.99
Print
$43.99
Subscription
$15.99 Monthly
eBook
$35.99 $24.99
Print
$43.99
Subscription
$15.99 Monthly

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Black & white paperback book shipped to your address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Aug 22, 2017
Length 178 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781786460110
Vendor :
Tableau
Category :
Languages :
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:

  9. The Welcome page will appear, and you should click Next to continue:

  10. The next item is the general license agreement. Click Next to continue:

  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:

  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.

  13. In the next screenshot, the 64-bit User Installation option has been selected:

  14. The next option is to customize the startup options. Here, the default is selected. Click Next to continue.

  15. The next option is to select the Start Menu folder configuration. Select the default, and click Next:

  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:

  17. In the next step, the R files are copied to the computer. This step should only take a few moments:

  18. Finally, R is installed, and you should receive a final window. Click Finish:

  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:

  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.

  4. In the next step, RStudio shortcuts are specified. Click on Install to proceed:

  5. RStudio installs in the next step:

  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.

Note

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:

  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.

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.

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Black & white paperback book shipped to your address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


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

Table of Contents

16 Chapters
Advanced Analytics with R and Tableau Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Authors Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Customer Feedback Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Advanced Analytics with R and Tableau Chevron down icon Chevron up icon
The Power of R Chevron down icon Chevron up icon
A Methodology for Advanced Analytics Using Tableau and R Chevron down icon Chevron up icon
Prediction with R and Tableau Using Regression Chevron down icon Chevron up icon
Classifying Data with Tableau Chevron down icon Chevron up icon
Advanced Analytics Using Clustering Chevron down icon Chevron up icon
Advanced Analytics with Unsupervised Learning Chevron down icon Chevron up icon
Interpreting Your Results for Your Audience Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela