Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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 Jen Stirrup Profile Icon Roberto Rösler Profile Icon Ruben Oliva Ramos
Arrow right icon
€8.99 €26.99
Full star icon Half star icon Empty star icon Empty star icon Empty star icon 1.3 (7 Ratings)
eBook 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 Jen Stirrup Profile Icon Roberto Rösler Profile Icon Ruben Oliva Ramos
Arrow right icon
€8.99 €26.99
Full star icon Half star icon Empty star icon Empty star icon Empty star icon 1.3 (7 Ratings)
eBook 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 eBook?

Product feature icon Instant access to your Digital eBook purchase
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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Advanced Analytics with R and Tableau

Chapter 2. The Power of R

Having understood how to integrate both the platforms in the previous chapter, we'll walk through the different ways in which you can use R to combine and compare data for analysis.

We will cover, with examples, the core essentials of R programming such as variables and data structures in R such as matrices, factors, vectors, and data frames. We will also focus on control mechanisms in R (relational operators, logical operators, conditional statements, loops, functions, and apply) and how to execute these commands in R to get grips with it before proceeding to chapters that heavily rely on these concepts for scripting complex analytical operations.

Core essentials of R programming

One of the reasons for R's success is its use of variables. Variables are used in all aspects of R programming. For example, variables can hold data, strings to access a database, whole models, queries, and test results. Variables are a key part of the modeling process, and their selection has a fundamental impact on the usefulness of the models. Therefore, variables are an important place to start since they are at the heart of R programming.

Variables

In the following section we will deal with the variables—how to create variables and working with variables.

Creating variables

It is very simple to create variables in R, and to save values in them. To create a variable, you simply need to give the variable a name, and assign a value to it.

In many other languages, such as SQL, it's necessary to specify the type of value that the variable will hold. So, for example, if the variable is designed to hold an integer or a string, then this is specified...

Data structures in R

The power of R resides in its ability to analyze data, and this ability is largely derived from its powerful data types. Fundamentally, R is a vectorized programming language. Data structures in R are constructed from vectors that are foundational. This means that R's operations are optimized to work with vectors.

Vector

The vector is a core component of R. It is a fundamental data type. Essentially, a vector is a data structure that contains an array where all of the values are the same type. For example, they could all be strings, or numbers. However, note that vectors cannot contain mixed data types.

R uses the c() function to take a list of items and turns them into a vector.

Lists

R contains two types of lists: a basic list, and a named list. A basic list is created using the list() operator. In a named list, every item in the list has a name as well as a value. named lists are a good mapping structure to help map data between R and Tableau. In R, lists are mapped...

Data frames

The data frame is the main data structure in R. It's possible to envisage the data frame as a table of data, with rows and columns. Unlike the list structure, the data frame can contain different types of data. In R, we use the data.frame() command in order to create a data frame.

The data frame is extremely flexible for working with structured data, and it can ingest data from many different data types. Two main ways to ingest data into data frames involves the use of many data connectors, which connect to data sources such as databases, for example. There is also a command, read.table(), which takes in data.

Data frames

Data Frame Structure

Here is an example, populated data frame. There are three columns, and two rows. The top of the data frame is the header. Each row holds a line of data row, starting with the row name, and then followed by the data itself. Each data member of a row is called a cell.

Data frames

Example Data Frame Structure

In R, we can create data frames by accessing external...

Control structures in R

R has the appearance of a procedural programming language. However, it is built on another language, known as S programming language. S leans towards functional programming. It also has some object-oriented characteristics. This means that there are many complexities in the way that R works.

In this section, we will look at some of the fundamental building blocks that make up key control structures in R, and then we will move onto looping and vectorized operations.

Assignment operators

R has five assignment operators, which are listed here:

<-

->

=

<<-

->>

In this book, we will use the following assignment operator:

<-

We will use this assignment operator here, because it is used commonly in examples on well-known internet sites such as StackOverflow (http://stackoverflow.com/). It's also possible to use the rightward assignment operator, but that is confusing for many people so it is not used here. Note also that the equals sign isn&apos...

For loops and vectorization in R

Specifically, we will look at the constructs involved in loops. Note, however, that it is more efficient to use vectorized operations rather than loops, because R is vector-based. We investigate loops here, because they are a good first step in understanding how R works, and then we can optimize this understanding by focusing on vectorized alternatives that are more efficient.

More information about control flows can be obtained by executing the command at the command line:

Help?Control

The control flow commands take decisions and make decisions between alternative actions. The main constructs are for, while, and repeat.

For loops

Let's look at a for loop in more detail. For this exercise, we will use the Fisher iris dataset, which is installed along with R by default. We are going to produce summary statistics for each species of iris in the dataset.

You can see some of the iris data by typing in the following command at the command prompt:

head(iris)

We...

Core essentials of R programming


One of the reasons for R's success is its use of variables. Variables are used in all aspects of R programming. For example, variables can hold data, strings to access a database, whole models, queries, and test results. Variables are a key part of the modeling process, and their selection has a fundamental impact on the usefulness of the models. Therefore, variables are an important place to start since they are at the heart of R programming.

Variables

In the following section we will deal with the variables—how to create variables and working with variables.

Creating variables

It is very simple to create variables in R, and to save values in them. To create a variable, you simply need to give the variable a name, and assign a value to it.

In many other languages, such as SQL, it's necessary to specify the type of value that the variable will hold. So, for example, if the variable is designed to hold an integer or a string, then this is specified at the point...

Data structures in R


The power of R resides in its ability to analyze data, and this ability is largely derived from its powerful data types. Fundamentally, R is a vectorized programming language. Data structures in R are constructed from vectors that are foundational. This means that R's operations are optimized to work with vectors.

Vector

The vector is a core component of R. It is a fundamental data type. Essentially, a vector is a data structure that contains an array where all of the values are the same type. For example, they could all be strings, or numbers. However, note that vectors cannot contain mixed data types.

R uses the c() function to take a list of items and turns them into a vector.

Lists

R contains two types of lists: a basic list, and a named list. A basic list is created using the list() operator. In a named list, every item in the list has a name as well as a value. named lists are a good mapping structure to help map data between R and Tableau. In R, lists are mapped using...

Data frames


The data frame is the main data structure in R. It's possible to envisage the data frame as a table of data, with rows and columns. Unlike the list structure, the data frame can contain different types of data. In R, we use the data.frame() command in order to create a data frame.

The data frame is extremely flexible for working with structured data, and it can ingest data from many different data types. Two main ways to ingest data into data frames involves the use of many data connectors, which connect to data sources such as databases, for example. There is also a command, read.table(), which takes in data.

Data Frame Structure

Here is an example, populated data frame. There are three columns, and two rows. The top of the data frame is the header. Each row holds a line of data row, starting with the row name, and then followed by the data itself. Each data member of a row is called a cell.

Example Data Frame Structure

In R, we can create data frames by accessing external data,...

Control structures in R


R has the appearance of a procedural programming language. However, it is built on another language, known as S programming language. S leans towards functional programming. It also has some object-oriented characteristics. This means that there are many complexities in the way that R works.

In this section, we will look at some of the fundamental building blocks that make up key control structures in R, and then we will move onto looping and vectorized operations.

Assignment operators

R has five assignment operators, which are listed here:

<-

->

=

<<-

->>

In this book, we will use the following assignment operator:

<-

We will use this assignment operator here, because it is used commonly in examples on well-known internet sites such as StackOverflow (http://stackoverflow.com/). It's also possible to use the rightward assignment operator, but that is confusing for many people so it is not used here. Note also that the equals sign isn't used here...

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 : 9781786460240
Vendor :
Tableau
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Aug 22, 2017
Length: 178 pages
Edition : 1st
Language : English
ISBN-13 : 9781786460240
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
Advanced Analytics with R and Tableau
€32.99
Mastering Tableau
€41.99
Learning Tableau 10
€45.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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.