Skip to content

Commit

Permalink
Update vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
hughjonesd committed Oct 1, 2024
1 parent 8243617 commit 21a047f
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 128 deletions.
8 changes: 4 additions & 4 deletions vignettes/design-principles-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<meta name="author" content="David Hugh-Jones" />

<meta name="date" content="2024-06-30" />
<meta name="date" content="2024-10-01" />

<title>Design Principles, Comparisons and Limitations</title>

Expand Down Expand Up @@ -353,15 +353,15 @@
<h1 class="title toc-ignore">Design Principles, Comparisons and
Limitations</h1>
<h4 class="author">David Hugh-Jones</h4>
<h4 class="date">2024-06-30</h4>
<h4 class="date">2024-10-01</h4>

</div>


<p>This document briefly describes the design of <a href="https://hughjonesd.github.io/huxtable/">huxtable</a>, and compares
it with other R packages for creating tables. A current version is on
the web in <a href="https://hughjonesd.github.io/huxtable/design-principles.html">HTML</a>
or <a href="https://hughjonesd.github.io/huxtable/design-principles.pdf">PDF</a>
the web in <a href="https://hughjonesd.github.io/huxtable/design-principles-html.html">HTML</a>
or <a href="https://hughjonesd.github.io/huxtable/design-principles-pdf.pdf">PDF</a>
formats.</p>
<div id="design-principles" class="section level2">
<h2>Design principles</h2>
Expand Down
Binary file modified vignettes/design-principles-pdf.pdf
Binary file not shown.
29 changes: 20 additions & 9 deletions vignettes/huxreg-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<meta name="author" content="David Hugh-Jones" />

<meta name="date" content="2024-06-30" />
<meta name="date" content="2024-10-01" />

<title>Regression Tables with huxreg</title>

Expand Down Expand Up @@ -352,7 +352,7 @@

<h1 class="title toc-ignore">Regression Tables with huxreg</h1>
<h4 class="author">David Hugh-Jones</h4>
<h4 class="date">2024-06-30</h4>
<h4 class="date">2024-10-01</h4>

</div>

Expand Down Expand Up @@ -496,11 +496,11 @@ <h2>Regression tables with <code>huxreg</code></h2>
are just standard huxtable commands.</p>
<pre class="r"><code>suppressPackageStartupMessages(library(dplyr))

diamond_regs %&gt;%
diamond_regs |&gt;
map_background_color(-1, -1, by_regex(
&quot;\\*&quot; = &quot;yellow&quot;
)) %&gt;%
set_italic(final(1), 1) %&gt;%
)) |&gt;
set_italic(final(1), 1) |&gt;
set_caption(&quot;Linear regressions of diamond prices&quot;)</code></pre>
<table class="huxtable" data-quarto-disable-processing="true" style="border-collapse: collapse; border: 0px; margin-bottom: 2em; margin-top: 2em; ; margin-left: auto; margin-right: auto; ">
<caption style="caption-side: top; text-align: center;">Linear regressions of diamond prices</caption><col><col><col><col><tr>
Expand Down Expand Up @@ -639,8 +639,8 @@ <h2>Regression tables with <code>huxreg</code></h2>
<code>broom::glance</code>:</p>
<pre class="r"><code>gl &lt;- as_hux(broom::glance(lm1))

gl %&gt;%
restack_down(cols = 3, on_remainder = &quot;fill&quot;) %&gt;%
gl |&gt;
restack_down(cols = 3, on_remainder = &quot;fill&quot;) |&gt;
set_bold(odds, everywhere)</code></pre>
<table class="huxtable" data-quarto-disable-processing="true" style="border-collapse: collapse; border: 0px; margin-bottom: 2em; margin-top: 2em; ; margin-left: auto; margin-right: auto; ">
<col><col><col><tr>
Expand Down Expand Up @@ -873,8 +873,19 @@ <h2>Altering data</h2>
<p>One way to do this is to pass a <code>tidy</code>-able test object
into <code>huxreg</code>. The function <code>coeftest</code> in the
“lmtest” package has <code>tidy</code> methods defined:</p>
<pre class="r"><code>library(lmtest)
library(sandwich)
<pre class="r"><code>library(lmtest)</code></pre>
<pre><code>## Loading required package: zoo</code></pre>
<pre><code>##
## Attaching package: &#39;zoo&#39;</code></pre>
<pre><code>## The following objects are masked from &#39;package:base&#39;:
##
## as.Date, as.Date.numeric</code></pre>
<pre><code>##
## Attaching package: &#39;lmtest&#39;</code></pre>
<pre><code>## The following object is masked from &#39;package:git2r&#39;:
##
## reset</code></pre>
<pre class="r"><code>library(sandwich)
lm_robust &lt;- coeftest(lm1, vcov = vcovHC, save = TRUE)
huxreg(&quot;Normal SEs&quot; = lm1, &quot;Robust SEs&quot; = lm_robust)</code></pre>
<table class="huxtable" data-quarto-disable-processing="true" style="border-collapse: collapse; border: 0px; margin-bottom: 2em; margin-top: 2em; ; margin-left: auto; margin-right: auto; ">
Expand Down
Binary file modified vignettes/huxreg-pdf.pdf
Binary file not shown.
220 changes: 110 additions & 110 deletions vignettes/huxtable-html.html

Large diffs are not rendered by default.

Binary file modified vignettes/huxtable-pdf.pdf
Binary file not shown.
10 changes: 5 additions & 5 deletions vignettes/themes-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
.hl.num {
color: #AF0F91;
}
.hl.str {
.hl.sng {
color: #317ECC;
}
.hl.com {
Expand All @@ -45,7 +45,7 @@
.hl.opt {
color: #000000;
}
.hl.std {
.hl.def {
color: #585858;
}
.hl.kwa {
Expand Down Expand Up @@ -276,11 +276,11 @@ <h2><pre>theme_green</pre></h2>
<h2><pre>theme_mondrian</pre></h2>
<table class="huxtable" data-quarto-disable-processing="true" style="border-collapse: collapse; border: 0px; margin-bottom: 2em; margin-top: 2em; ; margin-left: auto; margin-right: auto; ">
<col><col><col><tr>
<th style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Type</th><th style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; background-color: rgb(255, 255, 0); font-weight: normal;">Price</th><th style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Sugar content</th></tr>
<th style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Type</th><th style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Price</th><th style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Sugar content</th></tr>
<tr>
<td style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Strawberry</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">1.90</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">40.00%</td></tr>
<td style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Strawberry</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">1.90</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; background-color: rgb(255, 0, 0); font-weight: normal;">40.00%</td></tr>
<tr>
<td style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; background-color: rgb(255, 0, 0); font-weight: normal;">Raspberry</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">2.10</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">35.00%</td></tr>
<td style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Raspberry</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; background-color: rgb(255, 255, 0); font-weight: normal;">2.10</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">35.00%</td></tr>
<tr>
<td style="vertical-align: top; text-align: left; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">Plum</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">1.80</td><td style="vertical-align: top; text-align: right; white-space: normal; border-style: solid solid solid solid; border-width: 2pt 2pt 2pt 2pt; border-top-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); padding: 3pt 3pt 3pt 3pt; font-weight: normal;">50.00%</td></tr>
</table>
Expand Down

0 comments on commit 21a047f

Please sign in to comment.