Skip to content

Commit

Permalink
Deploying to gh-pages from @ 011cc82 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Feb 6, 2024
1 parent c9fbf91 commit 45aa426
Show file tree
Hide file tree
Showing 36 changed files with 1,628 additions and 1,628 deletions.
Binary file modified freeze.rds
Binary file not shown.
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ <h2 class="anchored" data-anchor-id="alternative-packages">Alternative packages<
<p>Here are a few totally biased (and possibly unfair) comments about each of them.</p>
<p>The first difference between <code>tinytable</code> and alternatives is that <code>tinytable</code> covers much of the same functionality without loading any other <code>R</code> package by default. I think it is very important for <code>R</code> package developers to have access to a table-drawing package that does not force them to import half of the <code>tidyverse</code>. In my view, this service to developers alone justifies writing a new package.</p>
<p>Now let’s consider alternatives one by one.</p>
<p><code>gt</code> (65 dependencies) is an amazingly powerful table-drawing package; possibly the most powerful in R. I like it <em>a lot</em>, and it is the one I recommend if you don’t find the features you need in <code>tinytable</code>. The reasons I don’t personally use <code>gt</code> on a day-to-day basis are entirely subjective. First, and least important, I find its syntax very verbose: customizing any aspect of a table always seems to take <em>many</em> keystrokes. Second, and this is obviously a reflection of my own limitations, but I have never quite figured out how <code>gt</code> actually works; it has so many exported functions (180+!) that I get lost. <code>gt</code> is more powerful than <code>tinytable</code>, but that power comes at the price of complexity. One goal of <code>tinytable</code> is to let you do 98% of what you need by learning 4 simple functions; then you can use a bit of CSS or LaTeX if you need extreme customization.</p>
<p><code>kableExtra</code> (49 dependencies) is a very flexible package <a href="http://haozhu233.github.io/kableExtra/">with amazing documentation.</a> Before writing <code>tinytable</code>, I actually made a few <a href="https://github.com/haozhu233/kableExtra/graphs/contributors">very minor contributions and bug fixes</a> to <code>kableExtra</code>. In the end, however, I concluded that while the package is great, its code base is too hard to maintain and extend. The challenge on the backend is that <code>kableExtra</code> accepts tables drawn as raw strings by the <code>knitr</code> package, and then modifies them using a series of complex regular expressions. The author has done truly amazing work, but it’s just a really difficult strategy to implement, scale, and maintain. (Incidentally, <code>kableExtra</code> is not very actively developed anymore.) Finally, I really like the concept of separating styling from data, and <code>kableExtra</code> modifies the content of every cell to style its content. That sometimes makes LaTeX and HTML code pretty hard to read and edit.</p>
<p><code>huxtable</code> (29 dependencies) is an interesting and powerful-looking package, but I know it less well than the others. The key design decision of the author is that each feature is implemented with a distinct function. I understand that design impulse: going through the documentation of a function with 50 arguments can be daunting. That said, I feel that sifting through a manual with 300+ exported functions also makes for a steep learning curve. In addition, I prefer HTML and LaTeX code to be human-readable, in case I need to tweak them by hand before publication; <code>huxtable</code> tables are not that.</p>
<p><code>DT</code> (43 dependencies) is nice, but it only draws HTML table, so that’s a non-starter for me. I need HTML, LaTeX, Word, PNG, PDF, and Typst output, depending on the project I am working on.</p>
<p><code>flextable</code> (43 dependencies) is nice, but it does not support LaTeX, and I need that format for “real work.”</p>
<p><code>gt</code> (65 dependencies) is an amazingly powerful table-drawing package; possibly the most powerful in R. I like it <em>a lot</em>, and it is the first package that I recommend you try if you don’t like <code>tinytable</code>. The reasons I don’t personally use <code>gt</code> on a day-to-day basis are entirely subjective. First, and least important, I find its syntax very verbose: customizing any aspect of a table always seems to take <em>many</em> keystrokes. Second, and this is obviously a reflection of my own limitations, but I have never quite figured out how <code>gt</code> actually works; it has so many exported functions (180+!) that I get lost. <code>gt</code> is obviously more powerful than <code>tinytable</code>, but that power comes at the price of complexity. One goal of <code>tinytable</code> is to let you do 98% of what you need by learning 4 simple functions; then you can learn a bit of CSS or LaTeX if you need extreme customization.</p>
<p><code>kableExtra</code> (49 dependencies) is a very flexible package <a href="http://haozhu233.github.io/kableExtra/">with amazing documentation.</a> Before write <code>tinytable</code>, I actually made a few <a href="https://github.com/haozhu233/kableExtra/graphs/contributors">minor contributions and bug fixes</a> to <code>kableExtra</code>. In the end, I concluded that the package was great and drew beautiful table, but that the code base was too hard to maintain and extend. The challenge is that <code>kableExtra</code> accepts tables drawn <strong>as raw strings</strong> by the <code>knitr</code> package, and then modifies them using a series of complex regular expressions. The author has done truly amazing work, but it’s just a really difficult strategy to implement, scale, and maintain. (Incidentally, <code>kableExtra</code> is not very actively developed anymore.) Finally, I really like the concept of separating styling from data, and <code>kableExtra</code> modifies the content of every cell to style its content.</p>
<p><code>huxtable</code> (29 dependencies) is an interesting and powerful-looking package, but I know it less well than the others. The key design decision of that package is that each feature is associated with a distinct function. I understand that design impulse, because going through the documentation of a function with 50 arguments can be daunting. But for me, at least, sifting through a manual with 300+ exported functions also makes for a steep learning curve. Also, I like HTML and LaTeX code to be readable and editable, in case I need to make micro-modifications before publication in a journal or website; <code>huxtable</code> code is not designed to be human-readable.</p>
<p><code>DT</code> (43 dependencies) is nice, but it only draws HTML table, so that was a non starter for me.</p>
<p><code>flextable</code> (43 dependencies) is nice, but it does not support LaTeX, and I need that format for my “real job.”</p>
<p>At this point, it’s useful to point out that there are also many packages to compute statistics and build tables (ex: <code>modelsummary</code>, <code>gtsummary</code>, <code>table1</code>). Many of those packages delegate the actual drawing of the tables (ie: lines and colors) to one of the table-drawing packages listed above. In that sense, <code>tinytable</code> should be seen as more of a complement than an alternative to data summary packages. The goal of <code>tinytable</code> is to help users and developers convert data frames into beautiful tables easily. What people put in those tables is outside the scope of <code>tinytable</code>. If you are interested in a package to create data summaries and regression tables/plots, please check out my <code>modelsummary</code> package: <a href="https://modelsummary.com" class="uri">https://modelsummary.com</a></p>
<p>Did I miss your favorite package? Drop me a note and I’ll add it to the list.</p>

Expand Down
24 changes: 12 additions & 12 deletions man/format_tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ <h3 class="anchored" data-anchor-id="examples">Examples</h3>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tinytable_i53qztd7k9wmq17bufas</title>
<title>tinytable_g4ufy27khnxcbucttkzq</title>
<style>
.table td.tinytable_css_cszclp39qlckew3oab6g, .table th.tinytable_css_cszclp39qlckew3oab6g { border-bottom: solid 0.1em #d3d8dc; }
.table td.tinytable_css_lypfm7swr3wdsxjsqxa7, .table th.tinytable_css_lypfm7swr3wdsxjsqxa7 { border-bottom: solid 0.1em #d3d8dc; }
</style>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
Expand All @@ -484,7 +484,7 @@ <h3 class="anchored" data-anchor-id="examples">Examples</h3>


<div class="container">
<table class="table table-borderless" id="tinytable_i53qztd7k9wmq17bufas" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing="true">
<table class="table table-borderless" id="tinytable_g4ufy27khnxcbucttkzq" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing="true">
<thead>

<tr>
Expand All @@ -495,37 +495,37 @@ <h3 class="anchored" data-anchor-id="examples">Examples</h3>

<tbody>
<tr>
<td> 9 998</td>
<td> 9 999</td>
<td>10 002</td>
</tr>
<tr>
<td>10 001</td>
<td> 9 999</td>
<td>10 000</td>
<td>10 000</td>
</tr>
<tr>
<td>10 001</td>
<td>10 000</td>
<td>10 002</td>
</tr>
</tbody>
</table>
</div>

<script>
function styleCell_tinytable_ivb3c2ppcdovqgwme6g0(i, j, css_id) {
var table = document.getElementById("tinytable_i53qztd7k9wmq17bufas");
function styleCell_tinytable_w43awi96r9j7jig98206(i, j, css_id) {
var table = document.getElementById("tinytable_g4ufy27khnxcbucttkzq");
table.rows[i].cells[j].classList.add(css_id);
}
function insertSpanRow(i, colspan, content) {
var table = document.getElementById('tinytable_i53qztd7k9wmq17bufas');
var table = document.getElementById('tinytable_g4ufy27khnxcbucttkzq');
var newRow = table.insertRow(i);
var newCell = newRow.insertCell(0);
newCell.setAttribute("colspan", colspan);
// newCell.innerText = content;
// this may be unsafe, but innerText does not interpret <br>
newCell.innerHTML = content;
}
window.addEventListener('load', function () { styleCell_tinytable_ivb3c2ppcdovqgwme6g0(0, 0, 'tinytable_css_cszclp39qlckew3oab6g') })
window.addEventListener('load', function () { styleCell_tinytable_ivb3c2ppcdovqgwme6g0(0, 1, 'tinytable_css_cszclp39qlckew3oab6g') })
window.addEventListener('load', function () { styleCell_tinytable_w43awi96r9j7jig98206(0, 0, 'tinytable_css_lypfm7swr3wdsxjsqxa7') })
window.addEventListener('load', function () { styleCell_tinytable_w43awi96r9j7jig98206(0, 1, 'tinytable_css_lypfm7swr3wdsxjsqxa7') })
</script>


Expand Down
Loading

0 comments on commit 45aa426

Please sign in to comment.