Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
dKvale committed Nov 28, 2023
1 parent 34d84f5 commit a4846c3
Showing 7 changed files with 69 additions and 77 deletions.
3 changes: 1 addition & 2 deletions content/_index.Rmd
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ htmltools::tagList(rmarkdown::html_dependency_font_awesome())

### <i class="fa fa-birthday-cake" aria-hidden="true"></i> Exercise Day

- [Agenda](page/exercise/day1/agenda.html)
- [AGENDA](page/exercise/day1/agenda.html)

1. [Taking inventory](page/exercise/day1/inventory_duty.html)
1. [Auditor in training](page/exercise/day1/inventory_duty_expanded.html)
@@ -101,7 +101,6 @@ htmltools::tagList(rmarkdown::html_dependency_font_awesome())
- [Slides](https://tidy-mn.github.io/R-camp-slides/day2/02-1-Data-wrangling.html#1)



### <i class="fa fa-video-camera"></i> <span style="font-size: 90%">2.2 - </span> [Forks in the road: `if_else` + `case_when`](page/videos/day2/02-2-forks-in-the-road)

- [Notes and code examples](page/day2.html#forks-in-the-road-if_else-case_when)
5 changes: 2 additions & 3 deletions content/page/exercise/day1/agenda.Rmd
Original file line number Diff line number Diff line change
@@ -12,11 +12,10 @@ output:

<br>


> **WELCOME!**
1. Instructor introductions
1. Day 1 review quiz
1. [Day 1 review quiz](https://forms.office.com/g/NQP4RH1Wsp)
- Questions and other review topics
1. Start a new R project
- Create an R script
@@ -25,7 +24,7 @@ output:
- Using `glimpse` and `summary` functions
- Using `filter` to match rows to conditions
- Writing data back to .CSV
1. Tidy Data Quiz
1. [Tidy Data Quiz](https://forms.office.com/g/5aiQv5uUTN)

> **10-minute Break**
4 changes: 2 additions & 2 deletions content/page/exercise/day1/agenda.html
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
<ol style="list-style-type: decimal">
<li>Instructor introductions<br />
</li>
<li>Day 1 review quiz
<li><a href="https://forms.office.com/g/NQP4RH1Wsp">Day 1 review quiz</a>
<ul>
<li>Questions and other review topics<br />
</li>
@@ -40,7 +40,7 @@
<li>Writing data back to .CSV<br />
</li>
</ul></li>
<li>Tidy Data Quiz</li>
<li><a href="https://forms.office.com/g/5aiQv5uUTN">Tidy Data Quiz</a></li>
</ol>
<blockquote>
<p><strong>10-minute Break</strong></p>
63 changes: 30 additions & 33 deletions content/page/exercise/day1/inventory_duty_expanded.html
Original file line number Diff line number Diff line change
@@ -99,12 +99,9 @@ <h1>Auditor-in-training</h1>
<p>The lead baking-bot is very impressed with our recent work. And now they’ve asked us perform a complete audit. This is our absolute dream come true. No one has been so excited to do an audit as we are RIGHT NOW!</p>
<p>In the audit we need to:</p>
<ul>
<li>Good labels: Check each ingredient has a category.</li>
<li>Ensure good labels: Check that each ingredient has a category.</li>
<li>Check for overstocking: No ingredient is more than 10 above its order threshold.</li>
<li>Calculate summary statistics for both dry and liquid measures.
<ul>
<li><em>(Don’t mix and match! Fluid ounces are different from dry ounces and gosh wouldn’t it be swell if everything was metric…)</em></li>
</ul></li>
<li>Calculate summary statistics for both dry and liquid measures.</li>
</ul>
<p><br></p>
<p>Now that we have our marching orders, it’s time to read in the data. Time to break out our handy-dandy <code>read_csv</code> and… wait a second… this data isn’t comma-delimited! What on earth are we going to do now?</p>
@@ -147,31 +144,31 @@ <h1>Categories for all</h1>
<p>Our first task it to make sure that each ingredient has a category. Let’s start by determining if anything <em>doesn’t</em> have a category.</p>
<div id="category-missing" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Category: Missing</h3>
<ul class="nav nav-pills" id="myTab6594" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab1716" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="categoryisna6594-tab" data-toggle="tab" href="#categoryisna6594" role="tab" aria-controls="categoryisna6594" aria-selected="true">Category is NA</a>
<a class="nav-link" id="categoryisna1716-tab" data-toggle="tab" href="#categoryisna1716" role="tab" aria-controls="categoryisna1716" aria-selected="true">Category is NA</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint6594-tab" data-toggle="tab" href="#showhint6594" role="tab" aria-controls="showhint6594" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint1716-tab" data-toggle="tab" href="#showhint1716" role="tab" aria-controls="showhint1716" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode6594-tab" data-toggle="tab" href="#showcode6594" role="tab" aria-controls="showcode6594" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode1716-tab" data-toggle="tab" href="#showcode1716" role="tab" aria-controls="showcode1716" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="categoryisna6594" class="tab-pane fade active in" role="tabpanel" aria-labelledby="categoryisna6594-tab">
<div id="categoryisna1716" class="tab-pane fade active in" role="tabpanel" aria-labelledby="categoryisna1716-tab">
<p><b> It can often be easier to look for the absence of something than the presence of something, in this case we want to identify all rows where Category is missing. </b></p>
<p><br></p>
</div>
<div id="showhint6594" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint6594-tab">
<div id="showhint1716" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint1716-tab">
<pre class="sourceCode r">
# What goes inside is.na() and what does is.na() do?

filter(audit_df, is.na( _____ ) )

</pre>
</div>
<div id="showcode6594" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode6594-tab">
<div id="showcode1716" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode1716-tab">
<pre class="sourceCode r">

filter(audit_df, is.na(CATEGORY))
@@ -200,28 +197,28 @@ <h1>Two new functions to save the day</h1>
<p>Now for the finishing touch! Similar to Excel, we can now specify the location to update using matrix-style indices: [<code>Row number</code>, <code>Column position</code>]</p>
<div id="writing-wrongs" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Writing wrongs</h3>
<ul class="nav nav-pills" id="myTab767" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab1851" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="updatingvalues767-tab" data-toggle="tab" href="#updatingvalues767" role="tab" aria-controls="updatingvalues767" aria-selected="true">Updating values</a>
<a class="nav-link" id="updatingvalues1851-tab" data-toggle="tab" href="#updatingvalues1851" role="tab" aria-controls="updatingvalues1851" aria-selected="true">Updating values</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint767-tab" data-toggle="tab" href="#showhint767" role="tab" aria-controls="showhint767" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint1851-tab" data-toggle="tab" href="#showhint1851" role="tab" aria-controls="showhint1851" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode767-tab" data-toggle="tab" href="#showcode767" role="tab" aria-controls="showcode767" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode1851-tab" data-toggle="tab" href="#showcode1851" role="tab" aria-controls="showcode1851" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="updatingvalues767" class="tab-pane fade active in" role="tabpanel" aria-labelledby="updatingvalues767-tab">
<div id="updatingvalues1851" class="tab-pane fade active in" role="tabpanel" aria-labelledby="updatingvalues1851-tab">
<p><b> Now we have the row and column location of the missing value and the types of acceptable values that it should be, overwrite the NA with the new value you picked. </b></p>
<p><br></p>
</div>
<div id="showhint767" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint767-tab">
<div id="showhint1851" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint1851-tab">
<pre class="sourceCode r">
audit_df[ROW, COLUMN] <- INSERT VALUE HERE
</pre>
</div>
<div id="showcode767" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode767-tab">
<div id="showcode1851" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode1851-tab">
<pre class="sourceCode r">

audit_df[18, 2] <- "ADDITITIVES"
@@ -243,31 +240,31 @@ <h1>Overstocked: Too many goods</h1>
<p>We don’t want too much food laying around or it might spoil. Let’s use filter to check each of the ingredient stock values and see if any are more than 10 above its order threshold. We’ve got this!</p>
<div id="not-on-my-watch" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Not on my watch!</h3>
<ul class="nav nav-pills" id="myTab5735" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab2071" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="10ormore5735-tab" data-toggle="tab" href="#10ormore5735" role="tab" aria-controls="10ormore5735" aria-selected="true">10 or more</a>
<a class="nav-link" id="10ormore2071-tab" data-toggle="tab" href="#10ormore2071" role="tab" aria-controls="10ormore2071" aria-selected="true">10 or more</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint5735-tab" data-toggle="tab" href="#showhint5735" role="tab" aria-controls="showhint5735" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint2071-tab" data-toggle="tab" href="#showhint2071" role="tab" aria-controls="showhint2071" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode5735-tab" data-toggle="tab" href="#showcode5735" role="tab" aria-controls="showcode5735" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode2071-tab" data-toggle="tab" href="#showcode2071" role="tab" aria-controls="showcode2071" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="id_10ormore5735" class="tab-pane fade active in" role="tabpanel" aria-labelledby="10ormore5735-tab">
<div id="id_10ormore2071" class="tab-pane fade active in" role="tabpanel" aria-labelledby="10ormore2071-tab">
<p><b> Filter the audit dataset to find any rows where the number of units in stock is 10 or more above the order threshold. </b></p>
<p><br></p>
</div>
<div id="showhint5735" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint5735-tab">
<div id="showhint2071" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint2071-tab">
<pre class="sourceCode r">
# Try doing some math in the filter function

filter(audit_df, SOMETHING_IS > ORDER_THRESHOLD + 10)

</pre>
</div>
<div id="showcode5735" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode5735-tab">
<div id="showcode2071" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode2071-tab">
<pre class="sourceCode r">

filter(audit_df, NUMBER_OF_UNITS_IN_STOCK > ORDER_THRESHOLD + 10)
@@ -312,29 +309,29 @@ <h1>Summary statistics by group</h1>
<p>Enough about eggs! Let’s make our summary stats and wrap up this audit.</p>
<div id="summary-stats" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Summary Stats</h3>
<ul class="nav nav-pills" id="myTab9610" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab4889" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="calcuatesummarystatistics9610-tab" data-toggle="tab" href="#calcuatesummarystatistics9610" role="tab" aria-controls="calcuatesummarystatistics9610" aria-selected="true">Calcuate summary statistics</a>
<a class="nav-link" id="calcuatesummarystatistics4889-tab" data-toggle="tab" href="#calcuatesummarystatistics4889" role="tab" aria-controls="calcuatesummarystatistics4889" aria-selected="true">Calcuate summary statistics</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint9610-tab" data-toggle="tab" href="#showhint9610" role="tab" aria-controls="showhint9610" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint4889-tab" data-toggle="tab" href="#showhint4889" role="tab" aria-controls="showhint4889" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode9610-tab" data-toggle="tab" href="#showcode9610" role="tab" aria-controls="showcode9610" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode4889-tab" data-toggle="tab" href="#showcode4889" role="tab" aria-controls="showcode4889" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="calcuatesummarystatistics9610" class="tab-pane fade active in" role="tabpanel" aria-labelledby="calcuatesummarystatistics9610-tab">
<div id="calcuatesummarystatistics4889" class="tab-pane fade active in" role="tabpanel" aria-labelledby="calcuatesummarystatistics4889-tab">
<p><b> Use the datasets that you made using filter to calculate summary statistics for each one and store them in another object (give it a good, descriptive name). </b></p>
<p><br></p>
</div>
<div id="showhint9610" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint9610-tab">
<div id="showhint4889" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint4889-tab">
<pre class="sourceCode r">
liquid_summary <- summary(_______)
dry_summary <- summary(_____)
</pre>
</div>
<div id="showcode9610" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode9610-tab">
<div id="showcode4889" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode4889-tab">
<pre class="sourceCode r">
liquid_summary <- summary(liquid)
dry_summary <- summary(dry)
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -317,7 +317,7 @@ <h3><i class="fa fa-video-camera" ></i> <span style="font-size: 90%">1.5 - </spa
<div id="exercise-day" class="section level3">
<h3><i class="fa fa-birthday-cake" aria-hidden="true"></i> Exercise Day</h3>
<ul>
<li><a href="page/exercise/day1/agenda.html">Agenda</a></li>
<li><a href="page/exercise/day1/agenda.html">AGENDA</a></li>
</ul>
<ol style="list-style-type: decimal">
<li><a href="page/exercise/day1/inventory_duty.html">Taking inventory</a></li>
4 changes: 2 additions & 2 deletions public/page/exercise/day1/agenda.html
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@ <h1>Day 1 Agenda</h1>
<ol style="list-style-type: decimal">
<li>Instructor introductions<br />
</li>
<li>Day 1 review quiz
<li><a href="https://forms.office.com/g/NQP4RH1Wsp">Day 1 review quiz</a>
<ul>
<li>Questions and other review topics<br />
</li>
@@ -325,7 +325,7 @@ <h1>Day 1 Agenda</h1>
<li>Writing data back to .CSV<br />
</li>
</ul></li>
<li>Tidy Data Quiz</li>
<li><a href="https://forms.office.com/g/5aiQv5uUTN">Tidy Data Quiz</a></li>
</ol>
<blockquote>
<p><strong>10-minute Break</strong></p>
65 changes: 31 additions & 34 deletions public/page/exercise/day1/inventory_duty_expanded.html
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@
"headline": "Auditor in Training - Exercise 2",
"description" : "Before you start… Jump back into the project you created for the previous exercise and then create a new R script.",
"inLanguage" : "en",
"wordCount": 1435 ,
"wordCount": 1416 ,
"datePublished" : "0001-01-01T00:00:00",
"dateModified" : "0001-01-01T00:00:00",
"image" : "https:\/\/tidy-mn.github.io\/R-camp-penguins\/images\/penguins_circle1.png",
@@ -367,12 +367,9 @@ <h1>Auditor-in-training</h1>
<p>The lead baking-bot is very impressed with our recent work. And now they’ve asked us perform a complete audit. This is our absolute dream come true. No one has been so excited to do an audit as we are RIGHT NOW!</p>
<p>In the audit we need to:</p>
<ul>
<li>Good labels: Check each ingredient has a category.</li>
<li>Ensure good labels: Check that each ingredient has a category.</li>
<li>Check for overstocking: No ingredient is more than 10 above its order threshold.</li>
<li>Calculate summary statistics for both dry and liquid measures.
<ul>
<li><em>(Don’t mix and match! Fluid ounces are different from dry ounces and gosh wouldn’t it be swell if everything was metric…)</em></li>
</ul></li>
<li>Calculate summary statistics for both dry and liquid measures.</li>
</ul>
<p><br></p>
<p>Now that we have our marching orders, it’s time to read in the data. Time to break out our handy-dandy <code>read_csv</code> and… wait a second… this data isn’t comma-delimited! What on earth are we going to do now?</p>
@@ -415,31 +412,31 @@ <h1>Categories for all</h1>
<p>Our first task it to make sure that each ingredient has a category. Let’s start by determining if anything <em>doesn’t</em> have a category.</p>
<div id="category-missing" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Category: Missing</h3>
<ul class="nav nav-pills" id="myTab6594" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab1716" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="categoryisna6594-tab" data-toggle="tab" href="#categoryisna6594" role="tab" aria-controls="categoryisna6594" aria-selected="true">Category is NA</a>
<a class="nav-link" id="categoryisna1716-tab" data-toggle="tab" href="#categoryisna1716" role="tab" aria-controls="categoryisna1716" aria-selected="true">Category is NA</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint6594-tab" data-toggle="tab" href="#showhint6594" role="tab" aria-controls="showhint6594" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint1716-tab" data-toggle="tab" href="#showhint1716" role="tab" aria-controls="showhint1716" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode6594-tab" data-toggle="tab" href="#showcode6594" role="tab" aria-controls="showcode6594" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode1716-tab" data-toggle="tab" href="#showcode1716" role="tab" aria-controls="showcode1716" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="categoryisna6594" class="tab-pane fade active in" role="tabpanel" aria-labelledby="categoryisna6594-tab">
<div id="categoryisna1716" class="tab-pane fade active in" role="tabpanel" aria-labelledby="categoryisna1716-tab">
<p><b> It can often be easier to look for the absence of something than the presence of something, in this case we want to identify all rows where Category is missing. </b></p>
<p><br></p>
</div>
<div id="showhint6594" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint6594-tab">
<div id="showhint1716" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint1716-tab">
<pre class="sourceCode r">
# What goes inside is.na() and what does is.na() do?

filter(audit_df, is.na( _____ ) )

</pre>
</div>
<div id="showcode6594" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode6594-tab">
<div id="showcode1716" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode1716-tab">
<pre class="sourceCode r">

filter(audit_df, is.na(CATEGORY))
@@ -468,28 +465,28 @@ <h1>Two new functions to save the day</h1>
<p>Now for the finishing touch! Similar to Excel, we can now specify the location to update using matrix-style indices: [<code>Row number</code>, <code>Column position</code>]</p>
<div id="writing-wrongs" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Writing wrongs</h3>
<ul class="nav nav-pills" id="myTab767" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab1851" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="updatingvalues767-tab" data-toggle="tab" href="#updatingvalues767" role="tab" aria-controls="updatingvalues767" aria-selected="true">Updating values</a>
<a class="nav-link" id="updatingvalues1851-tab" data-toggle="tab" href="#updatingvalues1851" role="tab" aria-controls="updatingvalues1851" aria-selected="true">Updating values</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint767-tab" data-toggle="tab" href="#showhint767" role="tab" aria-controls="showhint767" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint1851-tab" data-toggle="tab" href="#showhint1851" role="tab" aria-controls="showhint1851" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode767-tab" data-toggle="tab" href="#showcode767" role="tab" aria-controls="showcode767" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode1851-tab" data-toggle="tab" href="#showcode1851" role="tab" aria-controls="showcode1851" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="updatingvalues767" class="tab-pane fade active in" role="tabpanel" aria-labelledby="updatingvalues767-tab">
<div id="updatingvalues1851" class="tab-pane fade active in" role="tabpanel" aria-labelledby="updatingvalues1851-tab">
<p><b> Now we have the row and column location of the missing value and the types of acceptable values that it should be, overwrite the NA with the new value you picked. </b></p>
<p><br></p>
</div>
<div id="showhint767" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint767-tab">
<div id="showhint1851" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint1851-tab">
<pre class="sourceCode r">
audit_df[ROW, COLUMN] <- INSERT VALUE HERE
</pre>
</div>
<div id="showcode767" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode767-tab">
<div id="showcode1851" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode1851-tab">
<pre class="sourceCode r">

audit_df[18, 2] <- "ADDITITIVES"
@@ -511,31 +508,31 @@ <h1>Overstocked: Too many goods</h1>
<p>We don’t want too much food laying around or it might spoil. Let’s use filter to check each of the ingredient stock values and see if any are more than 10 above its order threshold. We’ve got this!</p>
<div id="not-on-my-watch" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Not on my watch!</h3>
<ul class="nav nav-pills" id="myTab5735" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab2071" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="10ormore5735-tab" data-toggle="tab" href="#10ormore5735" role="tab" aria-controls="10ormore5735" aria-selected="true">10 or more</a>
<a class="nav-link" id="10ormore2071-tab" data-toggle="tab" href="#10ormore2071" role="tab" aria-controls="10ormore2071" aria-selected="true">10 or more</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint5735-tab" data-toggle="tab" href="#showhint5735" role="tab" aria-controls="showhint5735" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint2071-tab" data-toggle="tab" href="#showhint2071" role="tab" aria-controls="showhint2071" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode5735-tab" data-toggle="tab" href="#showcode5735" role="tab" aria-controls="showcode5735" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode2071-tab" data-toggle="tab" href="#showcode2071" role="tab" aria-controls="showcode2071" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="id_10ormore5735" class="tab-pane fade active in" role="tabpanel" aria-labelledby="10ormore5735-tab">
<div id="id_10ormore2071" class="tab-pane fade active in" role="tabpanel" aria-labelledby="10ormore2071-tab">
<p><b> Filter the audit dataset to find any rows where the number of units in stock is 10 or more above the order threshold. </b></p>
<p><br></p>
</div>
<div id="showhint5735" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint5735-tab">
<div id="showhint2071" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint2071-tab">
<pre class="sourceCode r">
# Try doing some math in the filter function

filter(audit_df, SOMETHING_IS > ORDER_THRESHOLD + 10)

</pre>
</div>
<div id="showcode5735" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode5735-tab">
<div id="showcode2071" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode2071-tab">
<pre class="sourceCode r">

filter(audit_df, NUMBER_OF_UNITS_IN_STOCK > ORDER_THRESHOLD + 10)
@@ -580,29 +577,29 @@ <h1>Summary statistics by group</h1>
<p>Enough about eggs! Let’s make our summary stats and wrap up this audit.</p>
<div id="summary-stats" class="section level3 unnumbered quiz">
<h3><i class="fas fa-cookie-bite" style="color: gray;"></i> Summary Stats</h3>
<ul class="nav nav-pills" id="myTab9610" role="tablist" style="margin-top: 18px;">
<ul class="nav nav-pills" id="myTab4889" role="tablist" style="margin-top: 18px;">
<li class="nav-item active">
<a class="nav-link" id="calcuatesummarystatistics9610-tab" data-toggle="tab" href="#calcuatesummarystatistics9610" role="tab" aria-controls="calcuatesummarystatistics9610" aria-selected="true">Calcuate summary statistics</a>
<a class="nav-link" id="calcuatesummarystatistics4889-tab" data-toggle="tab" href="#calcuatesummarystatistics4889" role="tab" aria-controls="calcuatesummarystatistics4889" aria-selected="true">Calcuate summary statistics</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showhint9610-tab" data-toggle="tab" href="#showhint9610" role="tab" aria-controls="showhint9610" aria-selected="false">Show hint</a>
<a class="nav-link" id="showhint4889-tab" data-toggle="tab" href="#showhint4889" role="tab" aria-controls="showhint4889" aria-selected="false">Show hint</a>
</li>
<li class="nav-item">
<a class="nav-link" id="showcode9610-tab" data-toggle="tab" href="#showcode9610" role="tab" aria-controls="showcode9610" aria-selected="false">Show code</a>
<a class="nav-link" id="showcode4889-tab" data-toggle="tab" href="#showcode4889" role="tab" aria-controls="showcode4889" aria-selected="false">Show code</a>
</li>
</ul>
<div id="myTabContent" class="well tab-content" style="background-color: white;">
<div id="calcuatesummarystatistics9610" class="tab-pane fade active in" role="tabpanel" aria-labelledby="calcuatesummarystatistics9610-tab">
<div id="calcuatesummarystatistics4889" class="tab-pane fade active in" role="tabpanel" aria-labelledby="calcuatesummarystatistics4889-tab">
<p><b> Use the datasets that you made using filter to calculate summary statistics for each one and store them in another object (give it a good, descriptive name). </b></p>
<p><br></p>
</div>
<div id="showhint9610" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint9610-tab">
<div id="showhint4889" class="tab-pane fade" role="tabpanel" aria-labelledby="showhint4889-tab">
<pre class="sourceCode r">
liquid_summary <- summary(_______)
dry_summary <- summary(_____)
</pre>
</div>
<div id="showcode9610" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode9610-tab">
<div id="showcode4889" class="tab-pane fade" role="tabpanel" aria-labelledby="showcode4889-tab">
<pre class="sourceCode r">
liquid_summary <- summary(liquid)
dry_summary <- summary(dry)

0 comments on commit a4846c3

Please sign in to comment.