Skip to content

Commit

Permalink
Small update to Pt4 Slides
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlyons committed Nov 10, 2023
1 parent a06a1fb commit 0551700
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions slides/slides_pt4.html
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ <h2 id="combine-datetime-parts">Combine Date/Time Parts</h2>
<p><br />
</p>
</div>
<div id="missing-data" class="slide section level1">
<h1>Missing Data</h1>
<div id="dealing-with-missing-data" class="slide section level1">
<h1>Dealing with Missing Data</h1>
<style type="text/css">
span.mono {
font-family: monospace;
Expand Down Expand Up @@ -565,7 +565,6 @@ <h3 id="option-4-replace-missing-values-with-another-column">Option 4:
if_else(…)</span><span class="gray"> )</span></span></p>
<p><span class="mono"><span class="gray">mutate( </span>new_col =
coalesce(…)</span><span class="gray"> )</span></span></p>
<p><span class="mono">tidyr::replace_na()</span></p>
</div>
<p><br />
</p>
Expand Down Expand Up @@ -650,6 +649,14 @@ <h2 id="chaing-the-default-time-zone-on-posit-cloud">Chaing the Default
</div>
<p><br />
</p>
<h2 id="lags-and-leads">Lags and Leads</h2>
<p>To create a new column which includes lagged values, you can use</p>
<div class="indented2" style="font-family:monospace;">
<p>lag()</p>
<p>lead()</p>
</div>
<p><br />
</p>
<h2 id="saving-date-times-to-disk">Saving Date-Times to Disk</h2>
<div class="indented2">

Expand Down Expand Up @@ -679,7 +686,7 @@ <h2 id="saving-date-times-to-disk">Saving Date-Times to Disk</h2>
</div>
<div class="indented2 indented2r">
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb24-1"><a href="#cb24-1" tabindex="-1"></a><span class="fu">format</span>(<span class="fu">Sys.Date</span>(), <span class="st">&quot;%Y-%m-%d&quot;</span>)</span></code></pre></div>
<pre><code>## [1] &quot;2023-10-30&quot;</code></pre>
<pre><code>## [1] &quot;2023-11-10&quot;</code></pre>
</div>
<p><br />
</p>
Expand All @@ -696,7 +703,7 @@ <h2 id="saving-date-times-to-disk">Saving Date-Times to Disk</h2>
<p><code>lubridate</code> makes this easy with
<strong><code>format_ISO8601()</code></strong></p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb26-1"><a href="#cb26-1" tabindex="-1"></a>lubridate<span class="sc">::</span><span class="fu">format_ISO8601</span>(<span class="fu">Sys.time</span>(), <span class="at">usetz =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<pre><code>## [1] &quot;2023-10-30T09:47:55-0700&quot;</code></pre>
<pre><code>## [1] &quot;2023-11-10T10:09:01-0800&quot;</code></pre>
</div>
</div>
<p><br />
Expand Down

0 comments on commit 0551700

Please sign in to comment.