Skip to content

Commit

Permalink
Correct typos in eclipse post
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-dray committed Apr 10, 2024
1 parent 35022b8 commit b423372
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="3" data-categories="cli,r,rlang" data-listing-date-sort="1710201600000" data-listing-file-modified-sort="1712128006277" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="10">
<div class="g-col-1" data-index="3" data-categories="cli,r,rlang" data-listing-date-sort="1710201600000" data-listing-file-modified-sort="1712735666417" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="10">
<a href="./posts/2024-03-12-eclipse/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<div class="card-body post-contents">
Expand Down Expand Up @@ -258,7 +258,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="6" data-categories="dialga,r,webR" data-listing-date-sort="1705708800000" data-listing-file-modified-sort="1712699111799" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="5">
<div class="g-col-1" data-index="6" data-categories="dialga,r,webR" data-listing-date-sort="1705708800000" data-listing-file-modified-sort="1712735560940" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="5">
<a href="./posts/2024-01-20-webr-remote/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<div class="card-body post-contents">
Expand Down Expand Up @@ -978,7 +978,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="51" data-categories="gamedev,r,r.oguelike,videogames" data-listing-date-sort="1651359600000" data-listing-file-modified-sort="1712699456118" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="15">
<div class="g-col-1" data-index="51" data-categories="gamedev,r,r.oguelike,videogames" data-listing-date-sort="1651359600000" data-listing-file-modified-sort="1712735560939" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="15">
<a href="./posts/2022-05-01-dungeon/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<div class="card-body post-contents">
Expand Down
14 changes: 7 additions & 7 deletions _site/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ font-style: inherit;"># environment of parent function, not check_class() itself
<section id="ellipses" class="level3">
<h3 class="anchored" data-anchor-id="ellipses">Ellipses</h3>
<p>When a function has a dots (<code>...</code>) argument, it means you can pass an arbitrary number of objects to be captured. Consider <code>paste("You", "smell")</code> (two values), <code>paste("You", "smell", "wonderful")</code> (three), etc, or how you can provide an arbitrary number of column names to <code>dplyr::select()</code>.</p>
<p>The first argument to <code>check_class()</code> is <code>...</code>. You pass to it as many values as you need to assess for an expected class. So the function <code>add_one(x)</code> would contain a call to <code>check_class(x, "numeric")</code> (one argument to check), while <code>multiply(x, y)</code> could take <code>check_class(x, y, "numeric")</code> (two)<sup>2</sup>.</p>
<p>The first argument to <code>check_class()</code> is <code>...</code>. You pass to it as many values as you need to assess for an expected class. So the function <code>add_one(x)</code> would contain within it a call to <code>check_class(x, .expected_class = "numeric")</code> (one argument to check), while <code>multiply(x, y)</code> would accept <code>check_class(x, y, .expected_class = "numeric")</code> (two)<sup>2</sup>.</p>
<p>I’ve used the {rlang} package’s <code>dots_list()</code> function to collect the dots elements into a list. The <code>.named = TRUE</code> argument names each element, so we can pinpoint the errors and report them to the user.</p>
<p>I have collaborators, so readability of the code is important. I think <code>rlang::dots_list()</code> is more readable than the base approach, which is something like:</p>
<div class="cell">
Expand Down Expand Up @@ -1637,7 +1637,7 @@ font-style: inherit;">report_env</span>()</span>
background-color: null;
font-style: inherit;">report_env_2</span>()</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>&lt;environment: 0x11f0af038&gt;
<pre><code>&lt;environment: 0x10b25d0a0&gt;
Parent: &lt;environment: global&gt;</code></pre>
</div>
</div>
Expand Down Expand Up @@ -1821,7 +1821,7 @@ Session info
</summary>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>Last rendered: 2024-03-12 21:02:41 GMT</code></pre>
<pre><code>Last rendered: 2024-04-10 08:54:28 BST</code></pre>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>R version 4.3.1 (2023-06-16)
Expand All @@ -1842,11 +1842,11 @@ attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] digest_0.6.33 utf8_1.2.4 fastmap_1.1.1 xfun_0.41
[5] glue_1.7.0 knitr_1.45 htmltools_0.5.6.1 rmarkdown_2.25
[1] digest_0.6.35 utf8_1.2.4 fastmap_1.1.1 xfun_0.43
[5] glue_1.7.0 knitr_1.45 htmltools_0.5.8 rmarkdown_2.26
[9] lifecycle_1.0.4 cli_3.6.2 fansi_1.0.6 vctrs_0.6.5
[13] compiler_4.3.1 rstudioapi_0.15.0 tools_4.3.1 evaluate_0.23
[17] pillar_1.9.0 yaml_2.3.8 rlang_1.1.3 jsonlite_1.8.7
[13] compiler_4.3.1 rstudioapi_0.16.0 tools_4.3.1 evaluate_0.23
[17] pillar_1.9.0 yaml_2.3.8 rlang_1.1.3 jsonlite_1.8.8
[21] htmlwidgets_1.6.2</code></pre>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _site/posts/2022-05-01-dungeon/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
};

// Store cell data
globalThis.qwebrCellDetails = [{"code":"webr::install(\"r.oguelike\", repos = \"https://matt-dray.r-universe.dev\")\nwebr::install(\"crayon\")","id":1,"options":{"context":"setup"}},{"code":"r.oguelike::generate_dungeon(\n iterations = 4,\n n_row = 25,\n n_col = 40,\n n_rooms = 5,\n is_snake = FALSE,\n is_organic = TRUE\n)","id":2,"options":{"label":"generate-dungeon","context":"interactive"}}];
globalThis.qwebrCellDetails = [{"options":{"context":"setup"},"code":"webr::install(\"r.oguelike\", repos = \"https://matt-dray.r-universe.dev\")\nwebr::install(\"crayon\")","id":1},{"options":{"context":"interactive","label":"generate-dungeon"},"code":"r.oguelike::generate_dungeon(\n iterations = 4,\n n_row = 25,\n n_col = 40,\n n_rooms = 5,\n is_snake = FALSE,\n is_organic = TRUE\n)","id":2}];

</script>
<script type="module">
Expand Down
2 changes: 1 addition & 1 deletion _site/posts/2024-01-20-webr-remote/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
};

// Store cell data
globalThis.qwebrCellDetails = [{"id":1,"code":"webr::install(\"dialga\", repos = \"https://matt-dray.r-universe.dev\")","options":{"context":"setup"}},{"id":2,"code":"(cron_string <- dialga::r2cron(\n minutes = 0L:59L,\n hours = 0L:23L,\n days_month = 1L:31L,\n months = 1L:12L,\n days_week = 1L:7L\n))","options":{"context":"interactive"}},{"id":3,"code":"dialga::cron2eng(cron = cron_string)","options":{"context":"interactive"}}];
globalThis.qwebrCellDetails = [{"options":{"context":"setup"},"id":1,"code":"webr::install(\"dialga\", repos = \"https://matt-dray.r-universe.dev\")"},{"options":{"context":"interactive"},"id":2,"code":"(cron_string <- dialga::r2cron(\n minutes = 0L:59L,\n hours = 0L:23L,\n days_month = 1L:31L,\n months = 1L:12L,\n days_week = 1L:7L\n))"},{"options":{"context":"interactive"},"id":3,"code":"dialga::cron2eng(cron = cron_string)"}];

</script>
<script type="module">
Expand Down
14 changes: 7 additions & 7 deletions _site/posts/2024-03-12-eclipse/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ <h2 class="anchored" data-anchor-id="features">Features</h2>
<section id="ellipses" class="level3">
<h3 class="anchored" data-anchor-id="ellipses">Ellipses</h3>
<p>When a function has a dots (<code>...</code>) argument, it means you can pass an arbitrary number of objects to be captured. Consider <code>paste("You", "smell")</code> (two values), <code>paste("You", "smell", "wonderful")</code> (three), etc, or how you can provide an arbitrary number of column names to <code>dplyr::select()</code>.</p>
<p>The first argument to <code>check_class()</code> is <code>...</code>. You pass to it as many values as you need to assess for an expected class. So the function <code>add_one(x)</code> would contain a call to <code>check_class(x, "numeric")</code> (one argument to check), while <code>multiply(x, y)</code> could take <code>check_class(x, y, "numeric")</code> (two)<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>.</p>
<p>The first argument to <code>check_class()</code> is <code>...</code>. You pass to it as many values as you need to assess for an expected class. So the function <code>add_one(x)</code> would contain within it a call to <code>check_class(x, .expected_class = "numeric")</code> (one argument to check), while <code>multiply(x, y)</code> would accept <code>check_class(x, y, .expected_class = "numeric")</code> (two)<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>.</p>
<p>I’ve used the {rlang} package’s <code>dots_list()</code> function to collect the dots elements into a list. The <code>.named = TRUE</code> argument names each element, so we can pinpoint the errors and report them to the user.</p>
<p>I have collaborators, so readability of the code is important. I think <code>rlang::dots_list()</code> is more readable than the base approach, which is something like:</p>
<div class="cell">
Expand Down Expand Up @@ -359,7 +359,7 @@ <h3 class="anchored" data-anchor-id="eclipses">Eclipses</h3>
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>report_env_2 <span class="ot">&lt;-</span> <span class="cf">function</span>() <span class="fu">report_env</span>()</span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="fu">report_env_2</span>()</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>&lt;environment: 0x11f0af038&gt;
<pre><code>&lt;environment: 0x10b25d0a0&gt;
Parent: &lt;environment: global&gt;</code></pre>
</div>
</div>
Expand Down Expand Up @@ -441,7 +441,7 @@ <h2 class="anchored" data-anchor-id="error-helper-help">Error-helper help?</h2>
</summary>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>Last rendered: 2024-03-12 21:02:41 GMT</code></pre>
<pre><code>Last rendered: 2024-04-10 08:54:28 BST</code></pre>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>R version 4.3.1 (2023-06-16)
Expand All @@ -462,11 +462,11 @@ <h2 class="anchored" data-anchor-id="error-helper-help">Error-helper help?</h2>
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] digest_0.6.33 utf8_1.2.4 fastmap_1.1.1 xfun_0.41
[5] glue_1.7.0 knitr_1.45 htmltools_0.5.6.1 rmarkdown_2.25
[1] digest_0.6.35 utf8_1.2.4 fastmap_1.1.1 xfun_0.43
[5] glue_1.7.0 knitr_1.45 htmltools_0.5.8 rmarkdown_2.26
[9] lifecycle_1.0.4 cli_3.6.2 fansi_1.0.6 vctrs_0.6.5
[13] compiler_4.3.1 rstudioapi_0.15.0 tools_4.3.1 evaluate_0.23
[17] pillar_1.9.0 yaml_2.3.8 rlang_1.1.3 jsonlite_1.8.7
[13] compiler_4.3.1 rstudioapi_0.16.0 tools_4.3.1 evaluate_0.23
[17] pillar_1.9.0 yaml_2.3.8 rlang_1.1.3 jsonlite_1.8.8
[21] htmlwidgets_1.6.2</code></pre>
</div>
</div>
Expand Down
Loading

0 comments on commit b423372

Please sign in to comment.