Skip to content

Commit

Permalink
Create automated build
Browse files Browse the repository at this point in the history
  • Loading branch information
RRC_GHA committed Jun 11, 2024
1 parent f3f494c commit 3f097ac
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion public/2024-06-delta/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
"href": "session_07.html#now-all-together",
"title": "7  Cleaning and Wrangling Data",
"section": "7.15 Now, all together!",
"text": "7.15 Now, all together!\nWe just ran through the various things we can do with dplyr and tidyr but if you’re wondering how this might look in a real analysis. Let’s look at that now:\n\ncatch_original <- read_csv(url(\"https://knb.ecoinformatics.org/knb/d1/mn/v2/object/df35b.302.1\", \n method = \"libcurl\"))\n\nmean_region <- catch_original %>%\n select(-All, -notesRegCode) %>% \n mutate(Chinook = ifelse(Chinook == \"I\", 1, Chinook)) %>% \n mutate(Chinook = as.numeric(Chinook)) %>% \n pivot_longer(-c(Region, Year), \n names_to = \"species\", \n values_to = \"catch\") %>%\n mutate(catch = catch*1000) %>% \n group_by(Region) %>% \n summarize(mean_catch = mean(catch)) %>% \n arrange(desc(mean_catch))\n\nhead(mean_region)\n\n# A tibble: 6 × 2\n Region mean_catch\n <chr> <dbl>\n1 SSE 3184661.\n2 BRB 2709796.\n3 NSE 1825021.\n4 KOD 1528350 \n5 PWS 1419237.\n6 SOP 1110942.\n\n\nWe have completed our lesson on Cleaning and Wrangling data. Before we break, let’s practice our Git workflow.\n\n\n\n\n\n\nSteps\n\n\n\n\nSave the .qmd you have been working on for this lesson.\nRender the Quarto file. This is a way to test everything in your code is working.\nStage (Add) > Commit > Pull > Push",
"text": "7.15 Now, all together!\nWe just ran through the various things we can do with dplyr and tidyr but if you’re wondering how this might look in a real analysis. Let’s look at that now:\n\ncatch_original <- read_csv(\"https://knb.ecoinformatics.org/knb/d1/mn/v2/object/df35b.302.1\")\n\nmean_region <- catch_original %>%\n select(-All, -notesRegCode) %>% \n mutate(Chinook = if_else(Chinook == \"I\", \"1\", Chinook)) %>% \n mutate(Chinook = as.numeric(Chinook)) %>% \n pivot_longer(-c(Region, Year), \n names_to = \"species\", \n values_to = \"catch\") %>%\n mutate(catch = catch*1000) %>% \n group_by(Region) %>% \n summarize(mean_catch = mean(catch)) %>% \n arrange(desc(mean_catch))\n\nhead(mean_region)\n\n# A tibble: 6 × 2\n Region mean_catch\n <chr> <dbl>\n1 SSE 3184661.\n2 BRB 2709796.\n3 NSE 1825021.\n4 KOD 1528350 \n5 PWS 1419237.\n6 SOP 1110942.\n\n\nWe have completed our lesson on Cleaning and Wrangling data. Before we break, let’s practice our Git workflow.\n\n\n\n\n\n\nSteps\n\n\n\n\nSave the .qmd you have been working on for this lesson.\nRender the Quarto file. This is a way to test everything in your code is working.\nStage (Add) > Commit > Pull > Push",
"crumbs": [
"<span class='chapter-number'>7</span>  <span class='chapter-title'>Cleaning and Wrangling Data</span>"
]
Expand Down
31 changes: 15 additions & 16 deletions public/2024-06-delta/session_07.html
Original file line number Diff line number Diff line change
Expand Up @@ -1275,22 +1275,21 @@ <h2 data-number="7.14" class="anchored" data-anchor-id="splitting-a-column-using
<h2 data-number="7.15" class="anchored" data-anchor-id="now-all-together"><span class="header-section-number">7.15</span> Now, all together!</h2>
<p>We just ran through the various things we can do with <code>dplyr</code> and <code>tidyr</code> but if you’re wondering how this might look in a real analysis. Let’s look at that now:</p>
<div class="cell" data-catch="true">
<div class="sourceCode cell-code" id="cb54"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a>catch_original <span class="ot">&lt;-</span> <span class="fu">read_csv</span>(<span class="fu">url</span>(<span class="st">"https://knb.ecoinformatics.org/knb/d1/mn/v2/object/df35b.302.1"</span>, </span>
<span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a> <span class="at">method =</span> <span class="st">"libcurl"</span>))</span>
<span id="cb54-3"><a href="#cb54-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb54-4"><a href="#cb54-4" aria-hidden="true" tabindex="-1"></a>mean_region <span class="ot">&lt;-</span> catch_original <span class="sc">%&gt;%</span></span>
<span id="cb54-5"><a href="#cb54-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(<span class="sc">-</span>All, <span class="sc">-</span>notesRegCode) <span class="sc">%&gt;%</span> </span>
<span id="cb54-6"><a href="#cb54-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Chinook =</span> <span class="fu">ifelse</span>(Chinook <span class="sc">==</span> <span class="st">"I"</span>, <span class="dv">1</span>, Chinook)) <span class="sc">%&gt;%</span> </span>
<span id="cb54-7"><a href="#cb54-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Chinook =</span> <span class="fu">as.numeric</span>(Chinook)) <span class="sc">%&gt;%</span> </span>
<span id="cb54-8"><a href="#cb54-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">pivot_longer</span>(<span class="sc">-</span><span class="fu">c</span>(Region, Year), </span>
<span id="cb54-9"><a href="#cb54-9" aria-hidden="true" tabindex="-1"></a> <span class="at">names_to =</span> <span class="st">"species"</span>, </span>
<span id="cb54-10"><a href="#cb54-10" aria-hidden="true" tabindex="-1"></a> <span class="at">values_to =</span> <span class="st">"catch"</span>) <span class="sc">%&gt;%</span></span>
<span id="cb54-11"><a href="#cb54-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">catch =</span> catch<span class="sc">*</span><span class="dv">1000</span>) <span class="sc">%&gt;%</span> </span>
<span id="cb54-12"><a href="#cb54-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(Region) <span class="sc">%&gt;%</span> </span>
<span id="cb54-13"><a href="#cb54-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarize</span>(<span class="at">mean_catch =</span> <span class="fu">mean</span>(catch)) <span class="sc">%&gt;%</span> </span>
<span id="cb54-14"><a href="#cb54-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(<span class="fu">desc</span>(mean_catch))</span>
<span id="cb54-15"><a href="#cb54-15" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb54-16"><a href="#cb54-16" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(mean_region)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb54"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a>catch_original <span class="ot">&lt;-</span> <span class="fu">read_csv</span>(<span class="st">"https://knb.ecoinformatics.org/knb/d1/mn/v2/object/df35b.302.1"</span>)</span>
<span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb54-3"><a href="#cb54-3" aria-hidden="true" tabindex="-1"></a>mean_region <span class="ot">&lt;-</span> catch_original <span class="sc">%&gt;%</span></span>
<span id="cb54-4"><a href="#cb54-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(<span class="sc">-</span>All, <span class="sc">-</span>notesRegCode) <span class="sc">%&gt;%</span> </span>
<span id="cb54-5"><a href="#cb54-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Chinook =</span> <span class="fu">if_else</span>(Chinook <span class="sc">==</span> <span class="st">"I"</span>, <span class="st">"1"</span>, Chinook)) <span class="sc">%&gt;%</span> </span>
<span id="cb54-6"><a href="#cb54-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">Chinook =</span> <span class="fu">as.numeric</span>(Chinook)) <span class="sc">%&gt;%</span> </span>
<span id="cb54-7"><a href="#cb54-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">pivot_longer</span>(<span class="sc">-</span><span class="fu">c</span>(Region, Year), </span>
<span id="cb54-8"><a href="#cb54-8" aria-hidden="true" tabindex="-1"></a> <span class="at">names_to =</span> <span class="st">"species"</span>, </span>
<span id="cb54-9"><a href="#cb54-9" aria-hidden="true" tabindex="-1"></a> <span class="at">values_to =</span> <span class="st">"catch"</span>) <span class="sc">%&gt;%</span></span>
<span id="cb54-10"><a href="#cb54-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">catch =</span> catch<span class="sc">*</span><span class="dv">1000</span>) <span class="sc">%&gt;%</span> </span>
<span id="cb54-11"><a href="#cb54-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(Region) <span class="sc">%&gt;%</span> </span>
<span id="cb54-12"><a href="#cb54-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarize</span>(<span class="at">mean_catch =</span> <span class="fu">mean</span>(catch)) <span class="sc">%&gt;%</span> </span>
<span id="cb54-13"><a href="#cb54-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(<span class="fu">desc</span>(mean_catch))</span>
<span id="cb54-14"><a href="#cb54-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb54-15"><a href="#cb54-15" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(mean_region)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 6 × 2
Region mean_catch
Expand Down
Loading

0 comments on commit 3f097ac

Please sign in to comment.