Moving from data visualization into deeper, more advanced analytics, this book will intensify data skills for data-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.
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, 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.
Tableau (uniquely) offers excellent visualization combined with advanced analytics; R is at the pinnacle of statistical computational languages. When you want to move from one view of data to another, backed up by complex computations, the combination of R and Tableau is the perfect solution. This example-rich guide will teach you how to combine these two to perform advanced analytics by integrating Tableau with R to create beautiful data visualizations.
Chapter 1, Getting Ready for Tableau and R, shows how to connect Tableau Desktop with R through calculated fields and take advantage of R functions, libraries, packages, and even saved models. We'll also cover Tableau Server configuration with R through an instance of Rserve (through the tabadmin utility), allowing anyone to view a dashboard containing R functionality. Combining R with Tableau gives you the ability to bring deep statistical analysis into a drag-and-drop visual analytics environment.
Chapter 2, The Power of R, integrates both the platforms in the previous chapter; we'll walk through different ways in which readers can use R to combine and compare data for analysis. We will cover, with examples, the core essentials of R programming such as variables, data structures in R, control mechanisms in R, and how to execute these commands in R before proceeding to later chapters that heavily rely on these concepts to script complex analytical operations.
Chapter 3, A Methodology for Advanced Analytics using Tableau and R, creates a roadmap for our analytics investigation. You'll learn how to assess the performance of both supervised and unsupervised learning algorithms, and the importance of testing. Using R and Tableau, we will explore why and how you should split your data into a training set and a test set. In order to understand how to display the data accurately as well as beautifully in Tableau, the concepts of bias and variance are explained.
Chapter 4, Prediction with R and Tableau Using Regression, considers regression from an analytics point of view. In this chapter, we look at the predictive capabilities and performance of regression algorithms. At the end of this chapter, you'll have experience in simple linear regression, multi-linear regression, and k-nearest neighbors regression using a business-oriented understanding of the actual use cases of regression techniques.
Chapter 5, Classifying Data with Tableau, shows ways to perform classification using R and visualize the results in Tableau. Classification is one of the most important tasks in analytics today. By the end of this chapter, you'll build a decision tree and classify unseen observations with k-nearest neighbors, with a focus on a business-oriented understanding of the business question using classification algorithms.
Chapter 6, Advanced Analytics Using Clustering, gives a business-oriented understanding of the business questions using clustering algorithms and applying visualization techniques that best suit the scenario.
Chapter 7, Advanced Analytics with Unsupervised Learning, teaches k-means clustering and hierarchical clustering. It has a business-oriented understanding of the business question using unsupervised learning algorithms.
Chapter 8, Interpreting Your Results f or Your Audience. How do you interpret the results and the numbers when you have them? What does a p-value mean? Analytical investigations will result in a variety of relationships in data, but the audience may have problems understanding the results. Statistical tests state a null and an alternative hypothesis, and then calculate a test statistic and report an associated p-value. In this chapter, we will look at ways in which we can answer "what if?" questions and applicable customer scenarios using cohort analysis, with a focus on how we can display the results so that the audience can make a conclusion from the tests.
You'll need the following software:
R version 3.4.1
RStudio for Windows
Plugins for RStudio
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 starts off with concrete examples of R and will move on quickly to more advanced spheres of analytics using online data sources to support hands-on learning. Those R developers who want to integrate R with Tableau will also benefit from this book.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include directive."
A block of code is set as follows:
df = data.frame( Year=c(2013, 2013, 2013), Country=c("Arab World","Carribean States", "Central Europe"), LifeExpectancy=c(71, 72, 76))
Any command-line input or output is written as follows:
IrisBySpecies <- split(iris,iris$Species)
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this:"You can now just click on
Stream to access the live stream from the camera."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail
<[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Log in or register to our website using your e-mail address and password.
Hover the mouse pointer on the SUPPORT tab at the top.
Click on Code Downloads & Errata.
Enter the name of the book in the Search box.
Select the book for which you're looking to download the code files.
Choose from the drop-down menu where you purchased this book from.
Click on Code Download.
You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR / 7-Zip for Windows
Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Advanced-Analytics-with-R-and-Tableau. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at
<[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at
<[email protected]>, and we will do our best to address the problem.