<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Alex's Data Science Blog</title>
 <link href="http://alexsanjoseph.github.io/atom.xml" rel="self"/>
 <link href="http://alexsanjoseph.github.io"/>
 <updated>2020-10-14T10:37:37+00:00</updated>
 <id>http://alexsanjoseph.github.io</id>
 <author>
   <name>Alex Joseph</name>
   <email>alexsanjoseph@gmail.com</email>
 </author>

 
 <entry>
   <title>Comparing Dataframes In R Using Comparedf</title>
   <link href="http://alexsanjoseph.github.io/r/2018/10/03/comparing-dataframes-in-r-using-comparedf"/>
   <updated>2018-10-03T00:00:00+00:00</updated>
   <id>http://alexsanjoseph.github.io/r/2018/10/03/comparing-dataframes-in-r-using-comparedf</id>
   <content type="html">
&lt;p&gt;&lt;strong&gt;NOTE: This is a repost of an article that was first published in 2016&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt;

&lt;p&gt;Every so often while doing data analysis, I have come across a situation where I have
two datasets, which have the same structure but with small differences in the actual
data between the two. For example:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Variation of a dataset across different time periods for the same grouping&lt;/li&gt;
  &lt;li&gt;Variation of values for different algorithms, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the above cases, I want to easily identify what has changed across the two data.frames,
how much has changed, and also hopefully to get a quick summary of the extent of change. There are
packages like the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compare&lt;/code&gt; package on R, which have focused more on the structure of
the data frame and lesser on the data itself. I was not able to easily identify and
isolate what has changed in the data itself. So I decided to write one for myself. That is
what &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compareDF&lt;/code&gt; package is all about.&lt;/p&gt;

&lt;h1 id=&quot;usage&quot;&gt;Usage&lt;/h1&gt;

&lt;p&gt;The package has a single function, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compare_df&lt;/code&gt;. It takes in two data frames, and one or
more grouping variables and does a comparison between the the two. In addition you can
specify columns to ignore, decide how many rows of changes to be displayed in the case
of the HTML output, and decide what tolerance you want to provide to detect change.&lt;/p&gt;

&lt;h1 id=&quot;basic-example&quot;&gt;Basic Example&lt;/h1&gt;

&lt;p&gt;Let’s take the example of a teacher who wants to compare the marks and grades of students across
two years, 2010 and 2011. The data is stored in tabular format.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;../../compareDF/data/results_2010.rda&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;../../compareDF/data/results_2011.rda&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##    Division Student Maths Physics Chem Discipline PE Art
## 1         A   Isaac    90      84   91          B  B  34
## 2         A  Akshay    85      92   91          B  B  36
## 3         A Vishwas    93      93   92          A  B  21
## 4         A   Rohit    95      92   71          C  B  37
## 5         A    Venu    99      92   82          A  E  78
## 6         A  Ananth    99      81   91          B  A  24
## 7         B    Jojy    67      92   81          B  A  27
## 8         B   Bulla    84      73   81          C  A  68
## 9         B   Katti    90      95   99          C  B  49
## 10        B Dhakkan    78      96   71          C  C  39
## 11        B   Macho    90      82   81         A+  D  30
## 12        B  Mugger    95      71   94          A  C  26
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2011&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##    Division Student Maths Physics Chem Discipline PE Art
## 1         A   Isaac    90      84   91          A  B  34
## 2         A  Akshay    85      92   91          A  B  36
## 3         A Vishwas    82      93   92          B  B  21
## 4         A   Rohit    94      92   71          D  B  37
## 5         A    Venu   100      92   82          A  E  78
## 6         A  Ananth    78      81   91          B  A  24
## 7         B    Jojy    99      92   81          B  A  27
## 8         B   Bulla    97      73   81          C  A  68
## 9         B   Katti    78      95   99          C  B  49
## 10        B   Rohit    79      96   71          C  C  39
## 11        B   Macho    90      82   81         A+  D  30
## 12        B  Vikram    99      79   98          A  B  99
## 13        B DIkChik    91      71   84          E  C  99
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The data shows the performance of students in two divisions, A and B for two years. Some subjects
like &lt;em&gt;Maths, Physics, Chemistry and Art&lt;/em&gt; are given scores while others like &lt;em&gt;Discipline and PE&lt;/em&gt; are
given grades.&lt;/p&gt;

&lt;p&gt;It is possible that there are students of the same name in two divisions, for example, there is
a &lt;em&gt;Rohit&lt;/em&gt; in both the divisions in 2011.&lt;/p&gt;

&lt;p&gt;It is also possible that some students have dropped out, or added new across the two years.
Eg: - &lt;em&gt;Mugger and Dhakkan&lt;/em&gt; dropped out while &lt;em&gt;Vikram and Dikchik&lt;/em&gt; where added in the Division B&lt;/p&gt;

&lt;p&gt;The package allows a user to quickly identify these changes.&lt;/p&gt;

&lt;h2 id=&quot;basic-comparison&quot;&gt;Basic Comparison&lt;/h2&gt;
&lt;p&gt;Now let’s compare the performance of the students across the years. The grouping variables are the
&lt;em&gt;Student&lt;/em&gt; column. We will ignore the &lt;em&gt;Division&lt;/em&gt; column and assume that the student names are unique
across divisions. In this sub-example, if a student appears in two divisions, he/she has studied in both
of them.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;library&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compareDF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ctable_student&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compare_df&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2011&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Student&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Creating comparison table...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Loading required namespace: htmlTable
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Creating HTML table for first 100 rows
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;comparison_df&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##    Student chng_type Division Maths Physics Chem Discipline PE Art
## 1   Akshay         +        A    85      92   91          A  B  36
## 2   Akshay         -        A    85      92   91          B  B  36
## 3   Ananth         +        A    78      81   91          B  A  24
## 4   Ananth         -        A    99      81   91          B  A  24
## 5    Bulla         +        B    97      73   81          C  A  68
## 6    Bulla         -        B    84      73   81          C  A  68
## 7  Dhakkan         -        B    78      96   71          C  C  39
## 8    Isaac         +        A    90      84   91          A  B  34
## 9    Isaac         -        A    90      84   91          B  B  34
## 10    Jojy         +        B    99      92   81          B  A  27
## 11    Jojy         -        B    67      92   81          B  A  27
## 12   Katti         +        B    78      95   99          C  B  49
## 13   Katti         -        B    90      95   99          C  B  49
## 14  Mugger         -        B    95      71   94          A  C  26
## 15   Rohit         +        A    94      92   71          D  B  37
## 16   Rohit         +        B    79      96   71          C  C  39
## 17   Rohit         -        A    95      92   71          C  B  37
## 18    Venu         +        A   100      92   82          A  E  78
## 19    Venu         -        A    99      92   82          A  E  78
## 20 Vishwas         +        A    82      93   92          B  B  21
## 21 Vishwas         -        A    93      93   92          A  B  21
## 22 DIkChik         +        B    91      71   84          E  C  99
## 23  Vikram         +        B    99      79   98          A  B  99
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;By default, no columns are excluded from the comparison, so any of the tuple of grouping
variables which are different across the two data frames are shown in the comparison table.
The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comparison_df&lt;/code&gt; table shows all the rows for which at least one record has changed. Conversely, if
nothing has changed across the two tables, the rows are not displayed. If a new record has been
introduced or a record has been removed, those are displayed as well.&lt;/p&gt;

&lt;p&gt;For example, &lt;em&gt;Akshay, Division A&lt;/em&gt; has had the exact same scores but has two different grades for &lt;em&gt;Discipline&lt;/em&gt; across
the two years so that row is included.&lt;/p&gt;

&lt;p&gt;However, &lt;em&gt;Macho, Division B&lt;/em&gt; has had the exact same scores in both the years for all subjects, so his data is not
shown in the comparison table.&lt;/p&gt;

&lt;h2 id=&quot;html-output&quot;&gt;HTML Output&lt;/h2&gt;
&lt;p&gt;While the comparison table can be quickly summarized in various forms for futher analysis, it is
very difficult to  process visually. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;html_output&lt;/code&gt; provides a way to represent this is a way that is easier
for the numan eye to read. NOTE: You need to install the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;htmlTable&lt;/code&gt; package for the HTML comparison to work.
&lt;em&gt;For the purpose of the readme I am attaching the html as a png because github markdown doesn’t retain styles.&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ctable_student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;html_output&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table class=&quot;gmisc_table&quot; style=&quot;border-collapse: collapse; margin-top: 1em; margin-bottom: 1em;&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Student&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;chng_type&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Division&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Maths&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Physics&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Chem&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Discipline&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;PE&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Art&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Akshay&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;85&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Akshay&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;85&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Ananth&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Ananth&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Bulla&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;97&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;73&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Bulla&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;73&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;Dhakkan&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;96&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Isaac&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Isaac&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Jojy&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Jojy&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;67&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Katti&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Katti&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;Mugger&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;94&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;94&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;D&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;79&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;96&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Venu&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;100&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Venu&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Vishwas&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Vishwas&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;DIkChik&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;Vikram&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;79&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;98&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Now it is very easy to see recognize what has changed. A single cell is colored
if it has changed across the two datasets. The value of the cell in the older dataset
is colored red and the value of the cell in the newer dataset is colored green. Cells
that haven’t changed across the two datasets are colored grey.&lt;/p&gt;

&lt;p&gt;If a new row was introduced, the Row group names (and all the other columns for that row as well )
are colored in Green. Similarly, a row group name (and the other columns in that row) are
colored red if a row was removed.&lt;/p&gt;

&lt;p&gt;For Example, &lt;em&gt;Akshay&lt;/em&gt;, &lt;em&gt;Ananth&lt;/em&gt; and &lt;em&gt;Bulla&lt;/em&gt; has had changes in
scores, which are in &lt;em&gt;Discipline&lt;/em&gt;, &lt;em&gt;Maths&lt;/em&gt;, and &lt;em&gt;Maths&lt;/em&gt; respectively.
&lt;em&gt;Dhakkan&lt;/em&gt; and &lt;em&gt;Mugger&lt;/em&gt; have dropped out of the dataset from 2010 and the all the columns for the rows are shown
in red, which &lt;em&gt;DikChik&lt;/em&gt; and &lt;em&gt;Vikram&lt;/em&gt; have joined new in the data set and all the columns for the rows are in green.&lt;/p&gt;

&lt;p&gt;The same data is represented in tabular form (for further analysis, if necessary) in the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comparison_table_diff&lt;/code&gt; object&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;comparison_table_diff&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##    Student chng_type Division Maths Physics Chem Discipline PE Art
## 1        .         +        .     .       .    .          +  .   .
## 2        .         -        .     .       .    .          -  .   .
## 3        .         +        .     +       .    .          .  .   .
## 4        .         -        .     -       .    .          .  .   .
## 5        .         +        .     +       .    .          .  .   .
## 6        .         -        .     -       .    .          .  .   .
## 7        -         -        -     -       -    -          -  -   -
## 8        .         +        .     .       .    .          +  .   .
## 9        .         -        .     .       .    .          -  .   .
## 10       .         +        .     +       .    .          .  .   .
## 11       .         -        .     -       .    .          .  .   .
## 12       .         +        .     +       .    .          .  .   .
## 13       .         -        .     -       .    .          .  .   .
## 14       -         -        -     -       -    -          -  -   -
## 15       .         +        +     +       +    .          +  +   +
## 16       .         +        +     +       +    .          +  +   +
## 17       .         -        -     -       -    .          -  -   -
## 18       .         +        .     +       .    .          .  .   .
## 19       .         -        .     -       .    .          .  .   .
## 20       .         +        .     +       .    .          +  .   .
## 21       .         -        .     -       .    .          -  .   .
## 22       +         +        +     +       +    +          +  +   +
## 23       +         +        +     +       +    +          +  +   +
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;change-count-and-summary&quot;&gt;Change Count and Summary&lt;/h2&gt;
&lt;p&gt;You can get an details of what has changed for each group using
the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;change_count&lt;/code&gt; object in the output. A summary
of the same is provided in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;change_summary&lt;/code&gt; object.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;change_count&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Source: local data frame [13 x 4]
##
##    Student changes additions removals
##     (fctr)   (dbl)     (dbl)    (dbl)
## 1   Akshay       1         0        0
## 2   Ananth       1         0        0
## 3    Bulla       1         0        0
## 4  Dhakkan       0         1        0
## 5    Isaac       1         0        0
## 6     Jojy       1         0        0
## 7    Katti       1         0        0
## 8   Mugger       0         1        0
## 9    Rohit       1         0        1
## 10    Venu       1         0        0
## 11 Vishwas       1         0        0
## 12 DIkChik       0         0        1
## 13  Vikram       0         0        1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;change_summary&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##   old_obs   new_obs   changes additions  removals
##        12        13         9         2         3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;grouping-multiple-columns&quot;&gt;Grouping Multiple Columns&lt;/h2&gt;

&lt;p&gt;We can also group_multiple columns into the grouping variable&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student_div&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compare_df&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2011&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Division&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Student&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Grouping grouping columns
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Creating comparison table...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Creating HTML table for first 100 rows
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student_div&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;html_output&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table class=&quot;gmisc_table&quot; style=&quot;border-collapse: collapse; margin-top: 1em; margin-bottom: 1em;&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;grp&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;chng_type&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Division&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Student&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Maths&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Physics&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Chem&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Discipline&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;PE&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Art&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Akshay&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;85&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Akshay&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;85&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;2&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Ananth&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;2&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Ananth&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;3&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Isaac&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;3&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Isaac&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;4&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;94&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;D&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;4&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;5&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Venu&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;100&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;5&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Venu&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;6&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Vishwas&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;6&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Vishwas&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;7&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Bulla&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;97&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;73&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;7&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Bulla&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;73&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;8&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;DIkChik&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;9&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Jojy&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;9&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Jojy&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;67&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;10&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Katti&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;10&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Katti&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;12&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;79&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;96&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;13&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;Vikram&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;79&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;98&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;14&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;Dhakkan&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;96&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;15&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;Mugger&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;94&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; border-bottom: 2px solid grey; text-align: center;&quot;&gt;26&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Now &lt;em&gt;Rohits&lt;/em&gt; in each individual division are considered as belonging to separate
groups and compared accordingly. All the other summaries also change appropriately.&lt;/p&gt;

&lt;h2 id=&quot;excluding-certain-columns&quot;&gt;Excluding certain Columns&lt;/h2&gt;

&lt;p&gt;You can ignore certain columns using the &lt;em&gt;exclude&lt;/em&gt; parameter. The fields that have to be
excluded can be given as a character vector. (This is a convenience function to deal with
the case where some columns are not included)&lt;/p&gt;

&lt;h2 id=&quot;limiting-html-size&quot;&gt;Limiting HTML size&lt;/h2&gt;

&lt;p&gt;For dataframes which have a large amount of differences in them, generating HTML might take
a long time and crash your system. So the maximum diff size for the HTML (and for the HTML
visualization only) is capped at 100 by default. If you want to see more difference, you can change
the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;limit_html&lt;/code&gt; parameter appropriately. NOTE: This is only of the HTML output which is used for visual
checking. The main comparison data frame and the summaries ALWAYS include data from all the rows.&lt;/p&gt;

&lt;h2 id=&quot;tolerance&quot;&gt;Tolerance&lt;/h2&gt;

&lt;p&gt;It is possible that you’d like numbers very close to each other to be ignored. For example,
if the marks of a student vary by less that 5% across the years, it could be due to random
error and not any real performance indictaor. In such a case, you would want to give a tolerance
parameter. For this case, giving a tolerance of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.05&lt;/code&gt; would ignore all the changes that are
less than 5% apart from the lower value.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student_div&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compare_df&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2011&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results_2010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Division&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Student&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tolerance&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0.05&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Grouping grouping columns
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Creating comparison table...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Creating HTML table for first 100 rows
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ctable_student_div&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;html_output&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table class=&quot;gmisc_table&quot; style=&quot;border-collapse: collapse; margin-top: 1em; margin-bottom: 1em;&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;grp&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;chng_type&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Division&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Student&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Maths&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Physics&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Chem&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Discipline&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;PE&lt;/th&gt;
&lt;th style=&quot;border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: center;&quot;&gt;Art&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Akshay&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;85&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;1&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Akshay&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;85&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;2&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Ananth&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;2&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Ananth&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;3&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Isaac&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;3&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Isaac&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;4&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;94&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;D&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;4&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;6&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Vishwas&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;82&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;6&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Vishwas&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;93&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;7&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Bulla&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;97&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;73&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;7&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Bulla&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;73&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;8&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;DIkChik&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;91&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;84&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;E&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;9&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Jojy&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;9&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;Jojy&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;67&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;92&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;81&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #dedede; text-align: center;&quot;&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;10&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Katti&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;10&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;Katti&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; text-align: center;&quot;&gt;90&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: grey; background-color: #ffffff; text-align: center;&quot;&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;12&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;Rohit&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;79&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;96&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #dedede; text-align: center;&quot;&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;13&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;+&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;Vikram&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;79&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;98&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: green; background-color: #ffffff; text-align: center;&quot;&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #dedede;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;14&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;Dhakkan&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;78&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;96&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #dedede; text-align: center;&quot;&gt;39&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;background-color: #ffffff;&quot;&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;15&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;-&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;B&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;Mugger&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;95&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;71&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;94&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;A&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;C&lt;/td&gt;
&lt;td style=&quot;padding: .2em; color: red; background-color: #ffffff; border-bottom: 2px solid grey; text-align: center;&quot;&gt;26&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;em&gt;Venu from division A&lt;/em&gt; who had a score change from 100 to 99 is no longer present in the
diff calculation or in the output&lt;/p&gt;

&lt;p&gt;Naturally, tolerance has no meaning for non-numeric values.&lt;/p&gt;

&lt;h2 id=&quot;acknowledgements&quot;&gt;Acknowledgements&lt;/h2&gt;

&lt;p&gt;I’d like to thank System Insights Inc. for all the things that I have learned while working
there which I have used one way or the other in this package. Special thanks to Nitin for
proofreading the doc and making sure everything made sense.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A version of this blog has been published as the README for the &lt;a href=&quot;https://github.com/alexsanjoseph/compareDF&quot;&gt;package&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MTConnect Webinar Example</title>
   <link href="http://alexsanjoseph.github.io/mtconnect/2016/03/03/mtconnect-webinar-example"/>
   <updated>2016-03-03T00:00:00+00:00</updated>
   <id>http://alexsanjoseph.github.io/mtconnect/2016/03/03/mtconnect-webinar-example</id>
   <content type="html">
&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt;

&lt;p&gt;For a real life working example, we have this dataset graciously provided to us by the National Institute of Standards and Technology (http://www.nist.gov/) for one of their test bed parts. We will be trying to solve the first example from the introduction, which was a real problem faced by the NIST researchers. As we walk through each step of the exploratory process, you will understand how you can use similar techniques to solve similar issues that you might have with your Machine Tools.&lt;/p&gt;

&lt;h1 id=&quot;problem-statement&quot;&gt;Problem Statement&lt;/h1&gt;

&lt;p&gt;Accurately estimate the productive time of a part, from the data of a part that was manufactured with interruptions. Productive
time is defined as the time taken by the machine to complete the part excluding interruptions and inefficiencies.&lt;/p&gt;

&lt;h1 id=&quot;reading-data-into-r&quot;&gt;Reading Data into R&lt;/h1&gt;
&lt;p&gt;First let us define the data files that we are going to be working with. Two sets of
example data from the MTConnect Agent samples and the result of the MTConnect probe are provided
along with the package. We will be using the one provided by NIST for this analysis. Note that the
package can read in a compressed file as if it were a normal file as well for the samples.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;suppressPackageStartupMessages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtconnectR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;suppressPackageStartupMessages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dplyr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_path_dmtcd&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;../data/delimited_mtc_data/nist_test_bed/GF_Agie.tar.gz&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_path_xml&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;../data/delimited_mtc_data/nist_test_bed/Devices.xml&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;taking-a-quick-look-at-the-data-files&quot;&gt;Taking a quick look at the data files&lt;/h2&gt;

&lt;p&gt;Before we read in the data into the MTC Device Class, it might help us a bit in understanding
a bit about the data items that we have.&lt;/p&gt;

&lt;h2 id=&quot;devices-xml-data&quot;&gt;Devices XML Data&lt;/h2&gt;

&lt;h3 id=&quot;get_device_info_from_xml&quot;&gt;get_device_info_from_xml&lt;/h3&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MTConnectDevices&lt;/code&gt; XML document has information about the logical components of one or
more devices. This file can obtained using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;probe&lt;/code&gt; request from an MTConnect Agent.&lt;/p&gt;

&lt;p&gt;We can check out the devices for which the info is present in the devices XML using the
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;get_device_info_from_xml&lt;/code&gt; function. From the device info, we can select the name of the
device that we want to analyse further&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;device_info&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_device_info_from_xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_path_xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##                      name                           uuid           id
## 1 nist_testbed_Mazak_QT_1 nist_testbed_Mazak_QT_1_74fd52 Mazak_QT_1_1
## 2  nist_testbed_GF_Agie_1  nist_testbed_GF_Agie_1_3a0e8a GF_Agie_1_78
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;device_name&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;device_info&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;get_xpaths_from_xml&quot;&gt;get_xpaths_from_xml&lt;/h3&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;get_xpath_from_xml&lt;/code&gt; function can read in the xpath info for a single device into
a easily read data.frame format.&lt;/p&gt;

&lt;p&gt;The data.frame contains the id and name of each data item and the xpath along with the type,
category and subType of the data_item. It is easy to find out what are the data items of a
particular type using this function. For example, we are going to find out the conditions data
items which we will be using in the next step.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;xpath_info&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_xpaths_from_xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_path_xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;device_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xpath_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##        id      name           type  category subType
## 1 dtop_79     avail   AVAILABILITY     EVENT    &amp;lt;NA&amp;gt;
## 2 dtop_80     estop EMERGENCY_STOP     EVENT    &amp;lt;NA&amp;gt;
## 3 dtop_81    system         SYSTEM CONDITION    &amp;lt;NA&amp;gt;
## 4    X_84 Xposition       POSITION    SAMPLE  ACTUAL
## 5    Y_86 Yposition       POSITION    SAMPLE  ACTUAL
## 6    Z_88 Zposition       POSITION    SAMPLE  ACTUAL
##                                                       xpath
## 1        nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:avail&amp;lt;AVAILABILITY&amp;gt;
## 2      nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:estop&amp;lt;EMERGENCY_STOP&amp;gt;
## 3             nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:system&amp;lt;SYSTEM&amp;gt;
## 4 nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Xposition&amp;lt;POSITION-ACTUAL&amp;gt;
## 5 nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Yposition&amp;lt;POSITION-ACTUAL&amp;gt;
## 6 nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Zposition&amp;lt;POSITION-ACTUAL&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;getting-sample-data-by-parsing-mtconnectstreams-data&quot;&gt;Getting Sample data by parsing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MTConnectStreams&lt;/code&gt; data&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MTConnectStreams&lt;/code&gt; data from an MTConnect Agent can be collected using a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ruby&lt;/code&gt; script to
generate a delimited log of device data (referred to in this document as &lt;em&gt;log data&lt;/em&gt;) which is
then used by the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mtconnectR&lt;/code&gt; Package.&lt;/p&gt;

&lt;h2 id=&quot;creating-mtc-device-class&quot;&gt;Creating MTC Device Class&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;create_mtc_device_from_dmtcd&lt;/code&gt; function can read in both the Delimited MTConnect data (DMTCD)
and the xml data for a device and combine it into a single MTCDevice Class with the
data organized separately for each data item.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;create_mtc_device_from_dmtcd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_path_dmtcd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_path_xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;device_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Reading Delimted MTC data...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## 99.83% data contextualized successfuly!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nf&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data_item_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;exploring-different-data-items&quot;&gt;Exploring different data items&lt;/h1&gt;

&lt;p&gt;It looks like we have the position data items that we might need for this analysis in the log
data. Let’s see the variation in position. We can plot all the data items in one plot using
ggplot2.&lt;/p&gt;

&lt;h2 id=&quot;plotting-the-data&quot;&gt;Plotting the data&lt;/h2&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ggplot2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Loading required package: ggplot2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Warning: package 'ggplot2' was built under R version 3.2.4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;reshape2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Loading required package: reshape2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;xpos_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getDataItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Xposition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ypos_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getDataItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Yposition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;zpos_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getDataItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Zposition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xpos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-5-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ypos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-5-2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;zpos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-5-3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;merging-different-data-items-for-simultaneous-analysis&quot;&gt;Merging different data items for simultaneous analysis&lt;/h2&gt;

&lt;p&gt;It looks like the machine is going back and forth quite some distance quite often, across
all the axes. We also don’t know how this traversal varies across different axis.
However, we can get a much better idea of the motion if we could plot one
axis against the other. For that we have to merge the different data items. Since the
different data items have different timestamp values as the key, it is not as straightforward
as doing a join of one data item against the other. For this purpose, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mtconnect&lt;/code&gt; packge has a merge
method defined for the MTCDevice Class&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;position&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# merge all dataitems with the word position&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##                    timestamp
## 1 2015-11-02 14:58:49.994391
## 2 2015-11-02 14:59:03.742392
## 3 2015-11-02 14:59:03.886408
## 4 2015-11-02 14:59:14.122334
## 5 2015-11-02 14:59:14.270387
## 6 2015-11-02 14:59:22.486440
##   nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Aposition&amp;lt;ANGLE-ACTUAL&amp;gt;
## 1                                                -0.0001
## 2                                                -0.0001
## 3                                                -0.0001
## 4                                                -0.0001
## 5                                                -0.0001
## 6                                                -0.0001
##   nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Cposition&amp;lt;ANGLE-ACTUAL&amp;gt;
## 1                                                 0.0278
## 2                                                 0.0278
## 3                                                 0.0278
## 4                                                 0.0278
## 5                                                 0.0278
## 6                                                 0.0278
##   nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Xposition&amp;lt;POSITION-ACTUAL&amp;gt;
## 1                                                  33.69547
## 2                                                  33.69548
## 3                                                  33.69547
## 4                                                  33.69548
## 5                                                  33.69547
## 6                                                  33.69548
##   nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Yposition&amp;lt;POSITION-ACTUAL&amp;gt;
## 1                                                 -38.69783
## 2                                                 -38.69783
## 3                                                 -38.69783
## 4                                                 -38.69783
## 5                                                 -38.69783
## 6                                                 -38.69784
##   nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Zposition&amp;lt;POSITION-ACTUAL&amp;gt;
## 1                                                  20.37543
## 2                                                  20.37543
## 3                                                  20.37543
## 4                                                  20.37543
## 5                                                  20.37543
## 6                                                  20.37543
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Oops. Looks like we have also merged in the angular position. Let’s try a more
directed merge. Also, the names of the data items have the full xpaths attached to them. While this might be
useful in other circumstances to get the hierarchical position of the data, we can dispense with it
now using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;extract_param_from_xpath&lt;/code&gt; function. Let’s view the data after that&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;position&amp;lt;POSITION-ACTUAL&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# merge all dataitems with the word position&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extract_param_from_xpath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;DIName&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;show_warnings&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##                    timestamp Xposition Yposition Zposition
## 1 2015-11-02 14:58:49.994391  33.69547 -38.69783  20.37543
## 2 2015-11-02 14:59:03.742392  33.69548 -38.69783  20.37543
## 3 2015-11-02 14:59:03.886408  33.69547 -38.69783  20.37543
## 4 2015-11-02 14:59:14.122334  33.69548 -38.69783  20.37543
## 5 2015-11-02 14:59:14.270387  33.69547 -38.69783  20.37543
## 6 2015-11-02 14:59:22.486440  33.69548 -38.69784  20.37543
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Much better. Now let’s plot the data items in one shot.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Xpos'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Ypos'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Zposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Zpos'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;theme&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;legend.title&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;element_blank&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-8-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It does look the sudden traverals are simultaenous across the axes. Plotting one axes
against the other leads to the same conclusion. It also gives us an idea of the different
representations of the part&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-9-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Zposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-9-2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Zposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-9-3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So the machine tool is going to the origin every so often.&lt;/p&gt;

&lt;h1 id=&quot;deriving-new-process-parameters&quot;&gt;Deriving new process parameters&lt;/h1&gt;

&lt;p&gt;It might help our analysis to also calculate a few process parameters that the machine
tool is not providing directly. Here we are going to calculate the actual Path Feedrate
of the machine as it executes the process using the position data.&lt;/p&gt;

&lt;h2 id=&quot;derived-path-feedrate&quot;&gt;Derived Path Feedrate&lt;/h2&gt;

&lt;p&gt;Path Feedrate can be calculated as the rate of change of the position values. Here,
we must use the 3-dimensional distance value and not just one of the position vectors.&lt;/p&gt;

&lt;p&gt;PFR = Total Distance / Total Time
    = Sqrt(Sum of Squares of distane along individual axis) / time taken for motion&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;position_change_3d&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Zposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Zposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_taken&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;as.numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;as.numeric&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pfr&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;round&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;position_change_3d&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_taken&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dt.df&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;melt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;measure.vars&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pfr&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Xposition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Yposition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dt.df&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_line&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;variable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;facet_grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;variable&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scales&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;free_y&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Warning: Removed 1 rows containing missing values (geom_path).
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-10-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_step&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pfr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_step&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Warning: Removed 1 rows containing missing values (geom_path).
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-10-2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Let’s add this derived data back into the MTCDevice Class.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;pfr_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pfr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Structuring data correctly&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_data_item_to_mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pfr_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data_item_name&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pfr&amp;lt;PATH_FEEDRATE&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                                         &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data_item_type&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Sample&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;source_type&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;calculated&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data_item_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##  [1] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Aposition&amp;lt;ANGLE-ACTUAL&amp;gt;&quot;                                           
##  [2] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:avail&amp;lt;AVAILABILITY&amp;gt;&quot;                                               
##  [3] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Cposition&amp;lt;ANGLE-ACTUAL&amp;gt;&quot;                                           
##  [4] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:estop&amp;lt;EMERGENCY_STOP&amp;gt;&quot;                                             
##  [5] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:execution&amp;lt;EXECUTION&amp;gt;&quot;                                              
##  [6] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Fovr&amp;lt;PATH_FEEDRATE-OVERRIDE&amp;gt;&quot;                                      
##  [7] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:line&amp;lt;LINE&amp;gt;&quot;                                                        
##  [8] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:logic&amp;lt;LOGIC_PROGRAM&amp;gt;:81000045___69 COOLANT SWITCHED OFF&amp;lt;CONDITION&amp;gt;&quot;
##  [9] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:logic&amp;lt;LOGIC_PROGRAM&amp;gt;:81000046___70 FEED OVERRIDE = 0 %&amp;lt;CONDITION&amp;gt;&quot;
## [10] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:mode&amp;lt;CONTROLLER_MODE&amp;gt;&quot;                                             
## [11] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:move&amp;lt;x:MOTION&amp;gt;&quot;                                                    
## [12] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:program&amp;lt;PROGRAM&amp;gt;&quot;                                                  
## [13] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Sovr&amp;lt;SPINDLE_SPEED-OVERRIDE&amp;gt;&quot;                                      
## [14] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:system&amp;lt;SYSTEM&amp;gt;:34___Stylus already in contact&amp;lt;CONDITION&amp;gt;&quot;          
## [15] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:system&amp;lt;SYSTEM&amp;gt;:36___Probe system not ready&amp;lt;CONDITION&amp;gt;&quot;             
## [16] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:system&amp;lt;SYSTEM&amp;gt;:3AA___Key non-functional&amp;lt;CONDITION&amp;gt;&quot;                
## [17] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:system&amp;lt;SYSTEM&amp;gt;:454A___Limit switch Y+&amp;lt;CONDITION&amp;gt;&quot;                  
## [18] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Xposition&amp;lt;POSITION-ACTUAL&amp;gt;&quot;                                        
## [19] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Yposition&amp;lt;POSITION-ACTUAL&amp;gt;&quot;                                        
## [20] &quot;nist_testbed_GF_Agie_1&amp;lt;Device&amp;gt;:Zposition&amp;lt;POSITION-ACTUAL&amp;gt;&quot;                                        
## [21] &quot;pfr&amp;lt;PATH_FEEDRATE&amp;gt;&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;identifying-inefficiencies&quot;&gt;Identifying Inefficiencies&lt;/h1&gt;

&lt;h2 id=&quot;idle-times&quot;&gt;Idle times&lt;/h2&gt;
&lt;p&gt;Our first task is to identify the periods when the machine was idle. For this we
can use a few approaches.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Find out the times when the execution status was not active OR&lt;/li&gt;
  &lt;li&gt;Find out the times when the machine was not feeding (PFR~0) OR&lt;/li&gt;
  &lt;li&gt;Find the periods when the feed override was zero&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will be trying out all the approaches and choosing union of the three as the period
when machine is idle.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# Getting all the relevant data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mtc_device&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;EXECUTION|PATH_FEEDRATE|POSITION&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extract_param_from_xpath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;DIName&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;show_warnings&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;exec_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;feed_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;override_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Setting everything false by default&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;exec_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;exec_idle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;execution&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%in%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ACTIVE&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;feed_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;feed_idle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pfr&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;override_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;override_idle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fovr&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;machine_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;as.logical&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;exec_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;feed_idle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;override_idle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;  
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##                    timestamp execution   Fovr Xposition Yposition
## 1 2015-11-02 14:58:49.990541      &amp;lt;NA&amp;gt; 111.25        NA        NA
## 2 2015-11-02 14:58:49.994391      &amp;lt;NA&amp;gt; 111.25  33.69547 -38.69783
## 3 2015-11-02 14:59:03.742392      &amp;lt;NA&amp;gt; 111.25  33.69548 -38.69783
## 4 2015-11-02 14:59:03.886408      &amp;lt;NA&amp;gt; 111.25  33.69547 -38.69783
## 5 2015-11-02 14:59:14.122334      &amp;lt;NA&amp;gt; 111.25  33.69548 -38.69783
## 6 2015-11-02 14:59:14.270387      &amp;lt;NA&amp;gt; 111.25  33.69547 -38.69783
##   Zposition    pfr exec_idle feed_idle override_idle machine_idle
## 1        NA     NA      TRUE     FALSE         FALSE         TRUE
## 2  20.37543 0.0000      TRUE      TRUE         FALSE         TRUE
## 3  20.37543 0.0001      TRUE      TRUE         FALSE         TRUE
## 4  20.37543 0.0000      TRUE      TRUE         FALSE         TRUE
## 5  20.37543 0.0001      TRUE      TRUE         FALSE         TRUE
## 6  20.37543 0.0000      TRUE      TRUE         FALSE         TRUE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;machine-tool-at-origin&quot;&gt;Machine tool at origin&lt;/h2&gt;

&lt;p&gt;We need to identify the time spent by the machine at origin. Let’s look at the
X - Y graph again&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_pos_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;http://blog.alexsanjoseph.com/images/mtconnect_challenge_files/figure-html/unnamed-chunk-13-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It is clear that the periods when the machine was origin are roughly X &amp;gt; 30, Y &amp;lt; -30.
Adding this into the mix&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;merged_data_final&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;at_origin&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Setting everything false by default&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mutate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;at_origin&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;at_origin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Xposition&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Yposition&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-30&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;machine_idle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;at_origin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data_final&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##                    timestamp machine_idle at_origin
## 1 2015-11-02 14:58:49.990541         TRUE     FALSE
## 2 2015-11-02 14:58:49.994391         TRUE      TRUE
## 3 2015-11-02 14:59:03.742392         TRUE      TRUE
## 4 2015-11-02 14:59:03.886408         TRUE      TRUE
## 5 2015-11-02 14:59:14.122334         TRUE      TRUE
## 6 2015-11-02 14:59:14.270387         TRUE      TRUE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;calculating-summary-statistics&quot;&gt;Calculating Summary Statistics&lt;/h1&gt;

&lt;p&gt;Now we have all the data at our disposal to calculate the time statistics. First we
need to convert the time series into interval format to get the duratins. We can use
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;convert_ts_to_interval&lt;/code&gt; function to do the same.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;merged_data_intervals&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;convert_ts_to_interval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data_final&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data_intervals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;##                        start                        end duration
## 1 2015-11-02 14:58:49.990541 2015-11-02 08:58:49.994391     0.00
## 2 2015-11-02 14:58:49.994391 2015-11-02 08:59:03.742392    13.75
## 3 2015-11-02 14:59:03.742392 2015-11-02 08:59:03.886408     0.14
## 4 2015-11-02 14:59:03.886408 2015-11-02 08:59:14.122334    10.24
## 5 2015-11-02 14:59:14.122334 2015-11-02 08:59:14.270387     0.15
## 6 2015-11-02 14:59:14.270387 2015-11-02 08:59:22.486440     8.22
##   machine_idle at_origin
## 1         TRUE     FALSE
## 2         TRUE      TRUE
## 3         TRUE      TRUE
## 4         TRUE      TRUE
## 5         TRUE      TRUE
## 6         TRUE      TRUE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we can aggregate across the different states to find the total amount of time
in each state.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;merged_data_intervals&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;group_by&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;machine_idle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;at_origin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&amp;gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;summarise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;duration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;na.rm&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## Source: local data frame [4 x 3]
## Groups: machine_idle [?]
##
##   machine_idle at_origin total_time
##          (lgl)     (lgl)      (dbl)
## 1        FALSE     FALSE    2713.77
## 2        FALSE      TRUE      21.99
## 3         TRUE     FALSE    3339.20
## 4         TRUE      TRUE     576.95
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;efficient_time&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;inefficient_time&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;interrupted_time&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_at_origin&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;time_summary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)])&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## [1] &quot;Results&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## [1] &quot;Total Time of Operation (including interruptions) = 6651.91s&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## [1] &quot;Total Time without identified inefficiencies = 2713.77s&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## [1] &quot;Total Time wasted due to interruptions = 3916.15s&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;## [1] &quot;Total Time wasted due to being at origin = 598.94s&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 
</feed>
