<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Program Evaluation (PMAP 8521; Spring 2024) News</title>
<link>https://evalsp24.classes.andrewheiss.com/news/</link>
<atom:link href="https://evalsp24.classes.andrewheiss.com/news/index.xml" rel="self" type="application/rss+xml"/>
<description>Updates and FAQs for PMAP 8521 at Georgia State University</description>
<generator>quarto-1.5.27</generator>
<lastBuildDate>Tue, 09 Apr 2024 22:40:00 GMT</lastBuildDate>
<item>
  <title>Making nicer and fancier tables</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_tables-tinytable-modelsummary.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Many of you have asked about how to make prettier tables with R and Quarto. There’s a whole world of packages for making beautiful tables with R! Four of the most common ones are <a href="https://gt.rstudio.com/">{gt}</a>, the brand new and invented-to-improve-on-{kableExtra} <a href="https://vincentarelbundock.github.io/tinytable/">{tinytable}</a>, <a href="https://haozhu233.github.io/kableExtra/">{kableExtra}</a>, and <a href="https://ardata-fr.github.io/flextable-book/">{flextable}</a>:</p>
<div class="cell no-stripe" data-layout-align="center">
<div class="cell-output-display">
<div>
<div id="xttiiirwci" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>#xttiiirwci table {
  font-family: Barlow, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#xttiiirwci thead, #xttiiirwci tbody, #xttiiirwci tfoot, #xttiiirwci tr, #xttiiirwci td, #xttiiirwci th {
  border-style: none;
}

#xttiiirwci p {
  margin: 0;
  padding: 0;
}

#xttiiirwci .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#xttiiirwci .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#xttiiirwci .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#xttiiirwci .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#xttiiirwci .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#xttiiirwci .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#xttiiirwci .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#xttiiirwci .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: bold;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#xttiiirwci .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: bold;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#xttiiirwci .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#xttiiirwci .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#xttiiirwci .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#xttiiirwci .gt_spanner_row {
  border-bottom-style: hidden;
}

#xttiiirwci .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: bold;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#xttiiirwci .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: bold;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#xttiiirwci .gt_from_md > :first-child {
  margin-top: 0;
}

#xttiiirwci .gt_from_md > :last-child {
  margin-bottom: 0;
}

#xttiiirwci .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#xttiiirwci .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#xttiiirwci .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#xttiiirwci .gt_row_group_first td {
  border-top-width: 2px;
}

#xttiiirwci .gt_row_group_first th {
  border-top-width: 2px;
}

#xttiiirwci .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#xttiiirwci .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#xttiiirwci .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#xttiiirwci .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#xttiiirwci .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#xttiiirwci .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#xttiiirwci .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#xttiiirwci .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#xttiiirwci .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#xttiiirwci .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#xttiiirwci .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#xttiiirwci .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#xttiiirwci .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#xttiiirwci .gt_left {
  text-align: left;
}

#xttiiirwci .gt_center {
  text-align: center;
}

#xttiiirwci .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#xttiiirwci .gt_font_normal {
  font-weight: normal;
}

#xttiiirwci .gt_font_bold {
  font-weight: bold;
}

#xttiiirwci .gt_font_italic {
  font-style: italic;
}

#xttiiirwci .gt_super {
  font-size: 65%;
}

#xttiiirwci .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#xttiiirwci .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#xttiiirwci .gt_indent_1 {
  text-indent: 5px;
}

#xttiiirwci .gt_indent_2 {
  text-indent: 10px;
}

#xttiiirwci .gt_indent_3 {
  text-indent: 15px;
}

#xttiiirwci .gt_indent_4 {
  text-indent: 20px;
}

#xttiiirwci .gt_indent_5 {
  text-indent: 25px;
}
</style>

<table class="gt_table table table-sm table-striped small" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<colgroup>
<col style="width: 13%">
<col style="width: 6%">
<col style="width: 6%">
<col style="width: 6%">
<col style="width: 10%">
<col style="width: 59%">
</colgroup>
<thead>
<tr class="header gt_col_headings gt_spanner_row">
<th rowspan="2" id="Package" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">Package</th>
<th colspan="3" id="Output support" class="gt_center gt_columns_top_border gt_column_spanner_outer" data-quarto-table-cell-role="th" scope="colgroup"><span class="gt_column_spanner">Output support</span></th>
<th rowspan="2" id=" " class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col"></th>
<th rowspan="2" id="Notes" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">Notes</th>
</tr>
<tr class="odd gt_col_headings">
<th id="HTML" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">HTML</th>
<th id="PDF" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">PDF</th>
<th id="Word" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">Word</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr class="odd">
<td class="gt_row gt_left" headers="Package" style="vertical-align: top"><p><a href="https://gt.rstudio.com/"><strong>{gt}</strong></a></p></td>
<td class="gt_row gt_left" headers="HTML" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="PDF" style="vertical-align: top"><p>Okay</p></td>
<td class="gt_row gt_left" headers="Word" style="vertical-align: top"><p>Okay</p></td>
<td class="gt_row gt_left" headers="" style="vertical-align: top"><p><a href="https://gt.rstudio.com/articles/case-study-gtcars.html">Examples</a></p></td>
<td class="gt_row gt_left" headers="Notes" style="vertical-align: top"><p>Has the goal of becoming the “grammar of tables” (hence “gt”). It is supported by developers at Posit and gets updated and improved regularly. It’ll likely become the main table-making package for R.</p></td>
</tr>
<tr class="even">
<td class="gt_row gt_left" headers="Package" style="vertical-align: top"><p><a href="https://vincentarelbundock.github.io/tinytable/"><strong>{tinytable}</strong></a></p></td>
<td class="gt_row gt_left" headers="HTML" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="PDF" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="Word" style="vertical-align: top"><p>Okay</p></td>
<td class="gt_row gt_left" headers="" style="vertical-align: top"><p><a href="https://vincentarelbundock.github.io/tinytable/vignettes/tutorial.html">Examples</a></p></td>
<td class="gt_row gt_left" headers="Notes" style="vertical-align: top"><p>Made by the same developer as {modelsummary}, this brand new package essentially replaces the now-defunct {kableExtra} and is designed to work spectaularly well with PDF and HTML.</p></td>
</tr>
<tr class="odd">
<td class="gt_row gt_left" headers="Package" style="vertical-align: top"><p><a href="https://haozhu233.github.io/kableExtra/"><strong>{kableExtra}</strong></a></p></td>
<td class="gt_row gt_left" headers="HTML" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="PDF" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="Word" style="vertical-align: top"><p>Okay</p></td>
<td class="gt_row gt_left" headers="" style="vertical-align: top"><p><a href="https://haozhu233.github.io/kableExtra/awesome_table_in_html.html">Examples</a></p></td>
<td class="gt_row gt_left" headers="Notes" style="vertical-align: top"><p>Works really well for HTML output and has the best support for PDF output, but development has stalled for the past couple years and it seems to maybe be abandoned, which is sad.</p></td>
</tr>
<tr class="even">
<td class="gt_row gt_left" headers="Package" style="vertical-align: top"><p><a href="https://ardata-fr.github.io/flextable-book/"><strong>{flextable}</strong></a></p></td>
<td class="gt_row gt_left" headers="HTML" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="PDF" style="vertical-align: top"><p>Okay</p></td>
<td class="gt_row gt_left" headers="Word" style="vertical-align: top"><p><strong>Great</strong></p></td>
<td class="gt_row gt_left" headers="" style="vertical-align: top"><p><a href="https://ardata-fr.github.io/flextable-book/index.html#walkthrough-simple-example">Examples</a></p></td>
<td class="gt_row gt_left" headers="Notes" style="vertical-align: top"><p>Works really well for HTML output and has the best support for Word output. It’s not abandoned and gets regular updates.</p></td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</div>
<p>&nbsp;</p>
<section id="general-examples" class="level2">
<h2 class="anchored" data-anchor-id="general-examples">General examples</h2>
<p>Here’s a quick illustration of these packages. All four are incredibly powerful and let you do all sorts of really neat formatting things (<a href="https://gt.rstudio.com/reference/opt_interactive.html">{gt} even makes interactive HTML tables!</a>), so make sure you check out the documentation and examples. I personally use all of them, depending on which output I’m working with. When rendering to HTML, I use {gt} or {tinytable}; when rendering to PDF I use {tinytable} or {gt}; when knitting to Word I use {flextable}.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-1-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-1" aria-controls="tabset-1-1" aria-selected="true">Dataset to table-ify</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-2" aria-controls="tabset-1-2" aria-selected="false">{gt}</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-3" aria-controls="tabset-1-3" aria-selected="false">{tinytable}</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-4" aria-controls="tabset-1-4" aria-selected="false">{kableExtra}</a></li><li class="nav-item"><a class="nav-link" id="tabset-1-5-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-5" aria-controls="tabset-1-5" aria-selected="false">{flextable}</a></li></ul>
<div class="tab-content">
<div id="tabset-1-1" class="tab-pane active" aria-labelledby="tabset-1-1-tab">
<div class="cell" data-layout-align="center">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tidyverse)</span>
<span id="cb1-2"></span>
<span id="cb1-3">cars_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> mpg <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(year, drv) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarize</span>(</span>
<span id="cb1-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb1-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_mpg =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(hwy),</span>
<span id="cb1-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_mpg =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(hwy),</span>
<span id="cb1-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">min_mpg =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(hwy),</span>
<span id="cb1-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_mpg =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(hwy)</span>
<span id="cb1-11">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span></code></pre></div>
</div>
</div>
<div id="tabset-1-2" class="tab-pane" aria-labelledby="tabset-1-2-tab">
<div class="cell no-stripe" data-layout-align="center">
<div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(gt)</span>
<span id="cb2-2"></span>
<span id="cb2-3">cars_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(year) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gt</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cols_label</span>(</span>
<span id="cb2-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">drv =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Drive"</span>,</span>
<span id="cb2-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N"</span>,</span>
<span id="cb2-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_mpg =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average"</span>,</span>
<span id="cb2-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_mpg =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median"</span>,</span>
<span id="cb2-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">min_mpg =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Minimum"</span>,</span>
<span id="cb2-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_mpg =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Maximum"</span></span>
<span id="cb2-13">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tab_spanner</span>(</span>
<span id="cb2-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Highway MPG"</span>,</span>
<span id="cb2-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">columns =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(avg_mpg, median_mpg, min_mpg, max_mpg)</span>
<span id="cb2-17">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fmt_number</span>(</span>
<span id="cb2-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">columns =</span> avg_mpg,</span>
<span id="cb2-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">decimals =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb2-21">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tab_options</span>(</span>
<span id="cb2-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">row_group.as_column =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb2-24">  )</span></code></pre></div>
<div class="cell-output-display">
<div>
<div id="qxjdhscwca" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>#qxjdhscwca table {
  font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#qxjdhscwca thead, #qxjdhscwca tbody, #qxjdhscwca tfoot, #qxjdhscwca tr, #qxjdhscwca td, #qxjdhscwca th {
  border-style: none;
}

#qxjdhscwca p {
  margin: 0;
  padding: 0;
}

#qxjdhscwca .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#qxjdhscwca .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#qxjdhscwca .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#qxjdhscwca .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#qxjdhscwca .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#qxjdhscwca .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#qxjdhscwca .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#qxjdhscwca .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#qxjdhscwca .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#qxjdhscwca .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#qxjdhscwca .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#qxjdhscwca .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#qxjdhscwca .gt_spanner_row {
  border-bottom-style: hidden;
}

#qxjdhscwca .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#qxjdhscwca .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#qxjdhscwca .gt_from_md > :first-child {
  margin-top: 0;
}

#qxjdhscwca .gt_from_md > :last-child {
  margin-bottom: 0;
}

#qxjdhscwca .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#qxjdhscwca .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#qxjdhscwca .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#qxjdhscwca .gt_row_group_first td {
  border-top-width: 2px;
}

#qxjdhscwca .gt_row_group_first th {
  border-top-width: 2px;
}

#qxjdhscwca .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#qxjdhscwca .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#qxjdhscwca .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#qxjdhscwca .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#qxjdhscwca .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#qxjdhscwca .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#qxjdhscwca .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#qxjdhscwca .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#qxjdhscwca .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#qxjdhscwca .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#qxjdhscwca .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#qxjdhscwca .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#qxjdhscwca .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#qxjdhscwca .gt_left {
  text-align: left;
}

#qxjdhscwca .gt_center {
  text-align: center;
}

#qxjdhscwca .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#qxjdhscwca .gt_font_normal {
  font-weight: normal;
}

#qxjdhscwca .gt_font_bold {
  font-weight: bold;
}

#qxjdhscwca .gt_font_italic {
  font-style: italic;
}

#qxjdhscwca .gt_super {
  font-size: 65%;
}

#qxjdhscwca .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#qxjdhscwca .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#qxjdhscwca .gt_indent_1 {
  text-indent: 5px;
}

#qxjdhscwca .gt_indent_2 {
  text-indent: 10px;
}

#qxjdhscwca .gt_indent_3 {
  text-indent: 15px;
}

#qxjdhscwca .gt_indent_4 {
  text-indent: 20px;
}

#qxjdhscwca .gt_indent_5 {
  text-indent: 25px;
}
</style>

<table class="gt_table table table-sm table-striped small" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="header gt_col_headings gt_spanner_row">
<th rowspan="2" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col"></th>
<th rowspan="2" id="Drive" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">Drive</th>
<th rowspan="2" id="N" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">N</th>
<th colspan="4" id="Highway MPG" class="gt_center gt_columns_top_border gt_column_spanner_outer" data-quarto-table-cell-role="th" scope="colgroup"><span class="gt_column_spanner">Highway MPG</span></th>
</tr>
<tr class="odd gt_col_headings">
<th id="Average" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Average</th>
<th id="Median" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Median</th>
<th id="Minimum" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Minimum</th>
<th id="Maximum" class="gt_col_heading gt_columns_bottom_border gt_right" data-quarto-table-cell-role="th" scope="col">Maximum</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr class="odd gt_row_group_first">
<td rowspan="3" class="gt_row gt_left gt_stub_row_group" headers="1999 stub_1_1 stub_1">1999</td>
<td class="gt_row gt_left" headers="1999 stub_1_1 drv">4</td>
<td class="gt_row gt_right" headers="1999 stub_1_1 n">49</td>
<td class="gt_row gt_right" headers="1999 stub_1_1 avg_mpg">18.84</td>
<td class="gt_row gt_right" headers="1999 stub_1_1 median_mpg">17</td>
<td class="gt_row gt_right" headers="1999 stub_1_1 min_mpg">15</td>
<td class="gt_row gt_right" headers="1999 stub_1_1 max_mpg">26</td>
</tr>
<tr class="even">
<td class="gt_row gt_left" headers="1999 drv_2 drv">f</td>
<td class="gt_row gt_right" headers="1999 drv_2 n">57</td>
<td class="gt_row gt_right" headers="1999 drv_2 avg_mpg">27.91</td>
<td class="gt_row gt_right" headers="1999 drv_2 median_mpg">26</td>
<td class="gt_row gt_right" headers="1999 drv_2 min_mpg">21</td>
<td class="gt_row gt_right" headers="1999 drv_2 max_mpg">44</td>
</tr>
<tr class="odd">
<td class="gt_row gt_left" headers="1999 drv_3 drv">r</td>
<td class="gt_row gt_right" headers="1999 drv_3 n">11</td>
<td class="gt_row gt_right" headers="1999 drv_3 avg_mpg">20.64</td>
<td class="gt_row gt_right" headers="1999 drv_3 median_mpg">21</td>
<td class="gt_row gt_right" headers="1999 drv_3 min_mpg">16</td>
<td class="gt_row gt_right" headers="1999 drv_3 max_mpg">26</td>
</tr>
<tr class="even gt_row_group_first">
<td rowspan="3" class="gt_row gt_left gt_stub_row_group" headers="2008 stub_1_4 stub_1">2008</td>
<td class="gt_row gt_left" headers="2008 stub_1_4 drv">4</td>
<td class="gt_row gt_right" headers="2008 stub_1_4 n">54</td>
<td class="gt_row gt_right" headers="2008 stub_1_4 avg_mpg">19.48</td>
<td class="gt_row gt_right" headers="2008 stub_1_4 median_mpg">19</td>
<td class="gt_row gt_right" headers="2008 stub_1_4 min_mpg">12</td>
<td class="gt_row gt_right" headers="2008 stub_1_4 max_mpg">28</td>
</tr>
<tr class="odd">
<td class="gt_row gt_left" headers="2008 drv_5 drv">f</td>
<td class="gt_row gt_right" headers="2008 drv_5 n">49</td>
<td class="gt_row gt_right" headers="2008 drv_5 avg_mpg">28.45</td>
<td class="gt_row gt_right" headers="2008 drv_5 median_mpg">29</td>
<td class="gt_row gt_right" headers="2008 drv_5 min_mpg">17</td>
<td class="gt_row gt_right" headers="2008 drv_5 max_mpg">37</td>
</tr>
<tr class="even">
<td class="gt_row gt_left" headers="2008 drv_6 drv">r</td>
<td class="gt_row gt_right" headers="2008 drv_6 n">14</td>
<td class="gt_row gt_right" headers="2008 drv_6 avg_mpg">21.29</td>
<td class="gt_row gt_right" headers="2008 drv_6 median_mpg">21</td>
<td class="gt_row gt_right" headers="2008 drv_6 min_mpg">15</td>
<td class="gt_row gt_right" headers="2008 drv_6 max_mpg">26</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</div>
</div>
<div id="tabset-1-3" class="tab-pane" aria-labelledby="tabset-1-3-tab">
<div class="cell" data-layout-align="center">
<div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tinytable)</span>
<span id="cb3-2"></span>
<span id="cb3-3">cars_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>year) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rename</span>(</span>
<span id="cb3-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Drive"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> drv,</span>
<span id="cb3-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> n,</span>
<span id="cb3-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> avg_mpg,</span>
<span id="cb3-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> median_mpg,</span>
<span id="cb3-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Minimum"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> min_mpg,</span>
<span id="cb3-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Maximum"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> max_mpg</span>
<span id="cb3-12">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tt</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_tt</span>(</span>
<span id="cb3-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1999"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2008"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb3-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Highway MPG"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb3-17">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">style_tt</span>(</span>
<span id="cb3-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb3-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bold =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb3-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>,</span>
<span id="cb3-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line_color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#cccccc"</span></span>
<span id="cb3-23">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">style_tt</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">align =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb3-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_tt</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">num_fmt =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decimal"</span>)</span></code></pre></div>
<div class="cell-output-display">
 

  
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>tinytable_pxa6iln8lvcjic0rh8bi</title>
    <style>
.table td.tinytable_css_7qyb8ccy0nzj3ctwnlam, .table th.tinytable_css_7qyb8ccy0nzj3ctwnlam {    border-bottom: solid 0.1em #d3d8dc; }
.table td.tinytable_css_yfji7cr0r6rsg8ig32sf, .table th.tinytable_css_yfji7cr0r6rsg8ig32sf {    text-align: center; }
.table td.tinytable_css_o51fnzdpnuoyndpiyqq1, .table th.tinytable_css_o51fnzdpnuoyndpiyqq1 {    border-bottom: solid 0.05em #d3d8dc; }
.table td.tinytable_css_vf4y1466wjb2evhwfs2h, .table th.tinytable_css_vf4y1466wjb2evhwfs2h {   padding-left: 1em; }
.table td.tinytable_css_elbnv4xry8us9qg48buw, .table th.tinytable_css_elbnv4xry8us9qg48buw {    text-align: center; }
.table td.tinytable_css_yejurmcsswns44afpm03, .table th.tinytable_css_yejurmcsswns44afpm03 {    font-weight: bold; border-bottom: solid 0.1em #cccccc; }
.table td.tinytable_css_6ebp39yglslgoui5heus, .table th.tinytable_css_6ebp39yglslgoui5heus {    text-align: center; }
    </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>
    <script>
    MathJax = {
      tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']]
      },
      svg: {
        fontCache: 'global'
      }
    };
    </script>
  

  
    <div class="container">
      <table class="table table-borderless" id="tinytable_pxa6iln8lvcjic0rh8bi" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing="true">
        <thead>
<tr>
<th scope="col" align="center" colspan="1"> </th>
<th scope="col" align="center" colspan="1"> </th>
<th scope="col" align="center" colspan="4">Highway MPG</th>
</tr>
        
              <tr>
                <th scope="col">Drive</th>
                <th scope="col">N</th>
                <th scope="col">Average</th>
                <th scope="col">Median</th>
                <th scope="col">Minimum</th>
                <th scope="col">Maximum</th>
              </tr>
        </thead>
        
        <tbody>
                <tr>
                  <td>4</td>
                  <td>49</td>
                  <td>18.84</td>
                  <td>17</td>
                  <td>15</td>
                  <td>26</td>
                </tr>
                <tr>
                  <td>f</td>
                  <td>57</td>
                  <td>27.91</td>
                  <td>26</td>
                  <td>21</td>
                  <td>44</td>
                </tr>
                <tr>
                  <td>r</td>
                  <td>11</td>
                  <td>20.64</td>
                  <td>21</td>
                  <td>16</td>
                  <td>26</td>
                </tr>
                <tr>
                  <td>4</td>
                  <td>54</td>
                  <td>19.48</td>
                  <td>19</td>
                  <td>12</td>
                  <td>28</td>
                </tr>
                <tr>
                  <td>f</td>
                  <td>49</td>
                  <td>28.45</td>
                  <td>29</td>
                  <td>17</td>
                  <td>37</td>
                </tr>
                <tr>
                  <td>r</td>
                  <td>14</td>
                  <td>21.29</td>
                  <td>21</td>
                  <td>15</td>
                  <td>26</td>
                </tr>
        </tbody>
      </table>
    </div>

    <script>
      function styleCell_tinytable_aq0dfkxirmkjnf48uwij(i, j, css_id) {
        var table = document.getElementById("tinytable_pxa6iln8lvcjic0rh8bi");
        table.rows[i].cells[j].classList.add(css_id);
      }
      function insertSpanRow_8q3si8gjjmrcjymddii2(i, colspan, content) {
        var table = document.getElementById('tinytable_pxa6iln8lvcjic0rh8bi');
        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;
      }
      function spanCell_tinytable_aq0dfkxirmkjnf48uwij(i, j, rowspan, colspan) {
        var table = document.getElementById("tinytable_pxa6iln8lvcjic0rh8bi");
        const targetRow = table.rows[i];
        const targetCell = targetRow.cells[j];
        for (let r = 0; r < rowspan; r++) {
          // Only start deleting cells to the right for the first row (r == 0)
          if (r === 0) {
            // Delete cells to the right of the target cell in the first row
            for (let c = colspan - 1; c > 0; c--) {
              if (table.rows[i + r].cells[j + c]) {
                table.rows[i + r].deleteCell(j + c);
              }
            }
          }
          // For rows below the first, delete starting from the target column
          if (r > 0) {
            for (let c = colspan - 1; c >= 0; c--) {
              if (table.rows[i + r] && table.rows[i + r].cells[j]) {
                table.rows[i + r].deleteCell(j);
              }
            }
          }
        }
        // Set rowspan and colspan of the target cell
        targetCell.rowSpan = rowspan;
        targetCell.colSpan = colspan;
      }

window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 0, 'tinytable_css_7qyb8ccy0nzj3ctwnlam') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 1, 'tinytable_css_7qyb8ccy0nzj3ctwnlam') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 2, 'tinytable_css_7qyb8ccy0nzj3ctwnlam') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 3, 'tinytable_css_7qyb8ccy0nzj3ctwnlam') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 4, 'tinytable_css_7qyb8ccy0nzj3ctwnlam') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 5, 'tinytable_css_7qyb8ccy0nzj3ctwnlam') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 0, 'tinytable_css_yfji7cr0r6rsg8ig32sf') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 1, 'tinytable_css_yfji7cr0r6rsg8ig32sf') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 2, 'tinytable_css_yfji7cr0r6rsg8ig32sf') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 3, 'tinytable_css_yfji7cr0r6rsg8ig32sf') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 4, 'tinytable_css_yfji7cr0r6rsg8ig32sf') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 5, 'tinytable_css_yfji7cr0r6rsg8ig32sf') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 2, 'tinytable_css_o51fnzdpnuoyndpiyqq1') })
window.addEventListener('load', function () { insertSpanRow_8q3si8gjjmrcjymddii2(5, 6, '2008') });
window.addEventListener('load', function () { insertSpanRow_8q3si8gjjmrcjymddii2(2, 6, '1999') });
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(3, 0, 'tinytable_css_vf4y1466wjb2evhwfs2h') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(4, 0, 'tinytable_css_vf4y1466wjb2evhwfs2h') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(5, 0, 'tinytable_css_vf4y1466wjb2evhwfs2h') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(7, 0, 'tinytable_css_vf4y1466wjb2evhwfs2h') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(8, 0, 'tinytable_css_vf4y1466wjb2evhwfs2h') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(9, 0, 'tinytable_css_vf4y1466wjb2evhwfs2h') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 0, 'tinytable_css_elbnv4xry8us9qg48buw') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 1, 'tinytable_css_elbnv4xry8us9qg48buw') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 2, 'tinytable_css_elbnv4xry8us9qg48buw') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 3, 'tinytable_css_elbnv4xry8us9qg48buw') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 4, 'tinytable_css_elbnv4xry8us9qg48buw') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 5, 'tinytable_css_elbnv4xry8us9qg48buw') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 0, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 0, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 1, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 1, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 2, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 2, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 3, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 3, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 4, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 4, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 5, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 5, 'tinytable_css_yejurmcsswns44afpm03') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(0, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(1, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(2, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(3, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(3, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(3, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(3, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(3, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(4, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(4, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(4, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(4, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(4, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(5, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(5, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(5, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(5, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(5, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(6, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(7, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(7, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(7, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(7, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(7, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(8, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(8, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(8, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(8, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(8, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(9, 1, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(9, 2, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(9, 3, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(9, 4, 'tinytable_css_6ebp39yglslgoui5heus') })
window.addEventListener('load', function () { styleCell_tinytable_aq0dfkxirmkjnf48uwij(9, 5, 'tinytable_css_6ebp39yglslgoui5heus') })
    </script>

  


</div>
</div>
</div>
<div id="tabset-1-4" class="tab-pane" aria-labelledby="tabset-1-4-tab">
<div class="cell no-stripe" data-layout-align="center">
<div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(kableExtra)</span>
<span id="cb4-2"></span>
<span id="cb4-3">cars_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb4-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>year) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb4-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kbl</span>(</span>
<span id="cb4-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col.names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Drive"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Minimum"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Maximum"</span>),</span>
<span id="cb4-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb4-8">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb4-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable_styling</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb4-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pack_rows</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1999"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb4-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pack_rows</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2008"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb4-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add_header_above</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Highway MPG"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span></code></pre></div>
<div class="cell-output-display">
<div>
<table class="table table-sm table-striped small" data-quarto-postprocess="true">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th colspan="2" data-quarto-table-cell-role="th" style="empty-cells: hide; border-bottom: hidden"></th>
<th colspan="4" data-quarto-table-cell-role="th" style="text-align: center; border-bottom: hidden; padding-bottom: 0; padding-left: 3px; padding-right: 3px;"><div style="border-bottom: 1px solid #ddd; padding-bottom: 5px; ">
Highway MPG
</div></th>
</tr>
<tr class="odd">
<th style="text-align: left;" data-quarto-table-cell-role="th">Drive</th>
<th style="text-align: right;" data-quarto-table-cell-role="th">N</th>
<th style="text-align: right;" data-quarto-table-cell-role="th">Average</th>
<th style="text-align: right;" data-quarto-table-cell-role="th">Median</th>
<th style="text-align: right;" data-quarto-table-cell-role="th">Minimum</th>
<th style="text-align: right;" data-quarto-table-cell-role="th">Maximum</th>
</tr>
</thead>
<tbody>
<tr class="odd" data-grouplength="3">
<td colspan="6" style="border-bottom: 1px solid"><strong>1999</strong></td>
</tr>
<tr class="even">
<td style="text-align: left; padding-left: 2em;" data-indentlevel="1">4</td>
<td style="text-align: right;">49</td>
<td style="text-align: right;">18.84</td>
<td style="text-align: right;">17</td>
<td style="text-align: right;">15</td>
<td style="text-align: right;">26</td>
</tr>
<tr class="odd">
<td style="text-align: left; padding-left: 2em;" data-indentlevel="1">f</td>
<td style="text-align: right;">57</td>
<td style="text-align: right;">27.91</td>
<td style="text-align: right;">26</td>
<td style="text-align: right;">21</td>
<td style="text-align: right;">44</td>
</tr>
<tr class="even">
<td style="text-align: left; padding-left: 2em;" data-indentlevel="1">r</td>
<td style="text-align: right;">11</td>
<td style="text-align: right;">20.64</td>
<td style="text-align: right;">21</td>
<td style="text-align: right;">16</td>
<td style="text-align: right;">26</td>
</tr>
<tr class="odd" data-grouplength="3">
<td colspan="6" style="border-bottom: 1px solid"><strong>2008</strong></td>
</tr>
<tr class="even">
<td style="text-align: left; padding-left: 2em;" data-indentlevel="1">4</td>
<td style="text-align: right;">54</td>
<td style="text-align: right;">19.48</td>
<td style="text-align: right;">19</td>
<td style="text-align: right;">12</td>
<td style="text-align: right;">28</td>
</tr>
<tr class="odd">
<td style="text-align: left; padding-left: 2em;" data-indentlevel="1">f</td>
<td style="text-align: right;">49</td>
<td style="text-align: right;">28.45</td>
<td style="text-align: right;">29</td>
<td style="text-align: right;">17</td>
<td style="text-align: right;">37</td>
</tr>
<tr class="even">
<td style="text-align: left; padding-left: 2em;" data-indentlevel="1">r</td>
<td style="text-align: right;">14</td>
<td style="text-align: right;">21.29</td>
<td style="text-align: right;">21</td>
<td style="text-align: right;">15</td>
<td style="text-align: right;">26</td>
</tr>
</tbody>
</table>


</div>
</div>
</div>
</div>
<div id="tabset-1-5" class="tab-pane" aria-labelledby="tabset-1-5-tab">
<div class="cell" data-layout-align="center">
<div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(flextable)</span>
<span id="cb5-2"></span>
<span id="cb5-3">cars_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rename</span>(</span>
<span id="cb5-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Year"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> year,</span>
<span id="cb5-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Drive"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> drv,</span>
<span id="cb5-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> n,</span>
<span id="cb5-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> avg_mpg,</span>
<span id="cb5-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> median_mpg,</span>
<span id="cb5-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Minimum"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> min_mpg,</span>
<span id="cb5-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Maximum"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> max_mpg</span>
<span id="cb5-12">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Year =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(Year)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">flextable</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">colformat_double</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add_header_row</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Highway MPG"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colwidths =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">align</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">part =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"header"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">align =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"center"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">merge_v</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> Year) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb5-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">valign</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">valign =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top"</span>)</span></code></pre></div>
<div class="cell-output-display">
<div class="tabwid"><style>.cl-4fa0e38c{}.cl-4f9c6ec4{font-family:'Helvetica';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-4f9dd3c2{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-4f9dd3cc{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-4f9dd3d6{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-4f9dd3d7{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-4f9dde58{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 1.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde62{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 1.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde63{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 1.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde64{width:0.75in;background-color:transparent;vertical-align: top;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde6c{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde6d{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde6e{width:0.75in;background-color:transparent;vertical-align: top;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde76{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-4f9dde77{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 1.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table data-quarto-disable-processing="true" class="cl-4fa0e38c"><caption><p>Flextable example</p></caption><thead><tr style="overflow-wrap:break-word;"><th colspan="3" class="cl-4f9dde58"><p class="cl-4f9dd3c2"><span class="cl-4f9c6ec4"> </span></p></th><th colspan="4" class="cl-4f9dde58"><p class="cl-4f9dd3c2"><span class="cl-4f9c6ec4">Highway MPG</span></p></th></tr><tr style="overflow-wrap:break-word;"><th class="cl-4f9dde62"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">Year</span></p></th><th class="cl-4f9dde62"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">Drive</span></p></th><th class="cl-4f9dde63"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">N</span></p></th><th class="cl-4f9dde63"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">Average</span></p></th><th class="cl-4f9dde63"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">Median</span></p></th><th class="cl-4f9dde63"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">Minimum</span></p></th><th class="cl-4f9dde63"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">Maximum</span></p></th></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td rowspan="3" class="cl-4f9dde64"><p class="cl-4f9dd3d7"><span class="cl-4f9c6ec4">1999</span></p></td><td class="cl-4f9dde6c"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">4</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">49</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">18.84</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">17</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">15</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">26</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-4f9dde6c"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">f</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">57</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">27.91</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">26</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">21</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">44</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-4f9dde6c"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">r</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">11</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">20.64</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">21</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">16</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">26</span></p></td></tr><tr style="overflow-wrap:break-word;"><td rowspan="3" class="cl-4f9dde64"><p class="cl-4f9dd3d7"><span class="cl-4f9c6ec4">2008</span></p></td><td class="cl-4f9dde6c"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">4</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">54</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">19.48</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">19</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">12</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">28</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-4f9dde6c"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">f</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">49</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">28.45</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">29</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">17</span></p></td><td class="cl-4f9dde6d"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">37</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-4f9dde76"><p class="cl-4f9dd3cc"><span class="cl-4f9c6ec4">r</span></p></td><td class="cl-4f9dde77"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">14</span></p></td><td class="cl-4f9dde77"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">21.29</span></p></td><td class="cl-4f9dde77"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">21</span></p></td><td class="cl-4f9dde77"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">15</span></p></td><td class="cl-4f9dde77"><p class="cl-4f9dd3d6"><span class="cl-4f9c6ec4">26</span></p></td></tr></tbody></table></div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="fancier-modelsummary" class="level2">
<h2 class="anchored" data-anchor-id="fancier-modelsummary">Fancier {modelsummary}</h2>
<p>{modelsummary} works with all of these table-making packages, and you can control which one is used with the <code>output</code> argument. As of {modelsummary} v2.0, the default table-making backend is {tinytable} (it used to be {kableExtra}, but again, that’s relatively abandoned nowadays).</p>
<p>You can see <a href="https://modelsummary.com/vignettes/appearance.html">examples of how to use each of these table-making packages to customize {modelsummary} output at the documentation</a>.</p>
<p>Here’s one quick example using {tinytable} for customization:</p>
<div class="cell no-stripe" data-layout-align="center">
<div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(modelsummary)</span>
<span id="cb6-2"></span>
<span id="cb6-3">model1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(hwy <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> displ, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> mpg)</span>
<span id="cb6-4">model2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(hwy <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> displ <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> drv, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> mpg)</span>
<span id="cb6-5"></span>
<span id="cb6-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">modelsummary</span>(</span>
<span id="cb6-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(model1, model2),</span>
<span id="cb6-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stars =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb6-9">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rename the coefficients</span></span>
<span id="cb6-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coef_rename =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb6-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(Intercept)"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Intercept"</span>,</span>
<span id="cb6-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"displ"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Displacement"</span>,</span>
<span id="cb6-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drvf"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Drive (front)"</span>,</span>
<span id="cb6-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drvr"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Drive (rear)"</span>),</span>
<span id="cb6-15">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get rid of some of the extra goodness-of-fit statistics</span></span>
<span id="cb6-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">gof_omit =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"IC|RMSE|F|Log"</span>,</span>
<span id="cb6-17">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Use {tinytable} (this is optional since it's the default)</span></span>
<span id="cb6-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">output =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tinytable"</span></span>
<span id="cb6-19">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb6-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">style_tt</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">background =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yellow"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb6-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">style_tt</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">j =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">background =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>)</span></code></pre></div>
<div class="cell-output-display">
 

  
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>tinytable_t9kar4v5w4owos0iwiot</title>
    <style>
.table td.tinytable_css_47l0idi7qoq8bejw2cxo, .table th.tinytable_css_47l0idi7qoq8bejw2cxo {    border-bottom: solid 0.1em #d3d8dc; }
.table td.tinytable_css_3rsb3ewxrb2tl0k6wedc, .table th.tinytable_css_3rsb3ewxrb2tl0k6wedc {    text-align: left; }
.table td.tinytable_css_b042fpg5xrixzqqf47u3, .table th.tinytable_css_b042fpg5xrixzqqf47u3 {    text-align: center; }
.table td.tinytable_css_2ttxj0zr8l0ayki1n2x3, .table th.tinytable_css_2ttxj0zr8l0ayki1n2x3 {    text-align: center; }
.table td.tinytable_css_97kpfwk4hlnf1srl341l, .table th.tinytable_css_97kpfwk4hlnf1srl341l {    border-bottom: solid 0.05em black; }
.table td.tinytable_css_ypelpga08xjbvpx0iqi1, .table th.tinytable_css_ypelpga08xjbvpx0iqi1 {    background-color: yellow; }
.table td.tinytable_css_d1hk3tczb5urd931iq6m, .table th.tinytable_css_d1hk3tczb5urd931iq6m {    color: white; background-color: black; }
    </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>
    <script>
    MathJax = {
      tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']]
      },
      svg: {
        fontCache: 'global'
      }
    };
    </script>
  

  
    <div class="container">
      <table class="table table-borderless" id="tinytable_t9kar4v5w4owos0iwiot" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing="true">
        <thead>
        
              <tr>
                <th scope="col"> </th>
                <th scope="col">(1)</th>
                <th scope="col">(2)</th>
              </tr>
        </thead>
        <tfoot><tr><td colspan="3">+ p &lt; 0.1, * p &lt; 0.05, ** p &lt; 0.01, *** p &lt; 0.001</td></tr></tfoot>
        <tbody>
                <tr>
                  <td>Intercept    </td>
                  <td>35.698***</td>
                  <td>30.825***</td>
                </tr>
                <tr>
                  <td>             </td>
                  <td>(0.720)  </td>
                  <td>(0.924)  </td>
                </tr>
                <tr>
                  <td>Displacement </td>
                  <td>-3.531***</td>
                  <td>-2.914***</td>
                </tr>
                <tr>
                  <td>             </td>
                  <td>(0.195)  </td>
                  <td>(0.218)  </td>
                </tr>
                <tr>
                  <td>Drive (front)</td>
                  <td>         </td>
                  <td>4.791*** </td>
                </tr>
                <tr>
                  <td>             </td>
                  <td>         </td>
                  <td>(0.530)  </td>
                </tr>
                <tr>
                  <td>Drive (rear) </td>
                  <td>         </td>
                  <td>5.258*** </td>
                </tr>
                <tr>
                  <td>             </td>
                  <td>         </td>
                  <td>(0.734)  </td>
                </tr>
                <tr>
                  <td>Num.Obs.     </td>
                  <td>234      </td>
                  <td>234      </td>
                </tr>
                <tr>
                  <td>R2           </td>
                  <td>0.587    </td>
                  <td>0.736    </td>
                </tr>
                <tr>
                  <td>R2 Adj.      </td>
                  <td>0.585    </td>
                  <td>0.732    </td>
                </tr>
        </tbody>
      </table>
    </div>

    <script>
      function styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(i, j, css_id) {
        var table = document.getElementById("tinytable_t9kar4v5w4owos0iwiot");
        table.rows[i].cells[j].classList.add(css_id);
      }
      function insertSpanRow(i, colspan, content) {
        var table = document.getElementById('tinytable_t9kar4v5w4owos0iwiot');
        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;
      }
      function spanCell_tinytable_qmjia0wjs6d8p2ex5q0h(i, j, rowspan, colspan) {
        var table = document.getElementById("tinytable_t9kar4v5w4owos0iwiot");
        const targetRow = table.rows[i];
        const targetCell = targetRow.cells[j];
        for (let r = 0; r < rowspan; r++) {
          // Only start deleting cells to the right for the first row (r == 0)
          if (r === 0) {
            // Delete cells to the right of the target cell in the first row
            for (let c = colspan - 1; c > 0; c--) {
              if (table.rows[i + r].cells[j + c]) {
                table.rows[i + r].deleteCell(j + c);
              }
            }
          }
          // For rows below the first, delete starting from the target column
          if (r > 0) {
            for (let c = colspan - 1; c >= 0; c--) {
              if (table.rows[i + r] && table.rows[i + r].cells[j]) {
                table.rows[i + r].deleteCell(j);
              }
            }
          }
        }
        // Set rowspan and colspan of the target cell
        targetCell.rowSpan = rowspan;
        targetCell.colSpan = colspan;
      }

window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(0, 0, 'tinytable_css_47l0idi7qoq8bejw2cxo') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(0, 1, 'tinytable_css_47l0idi7qoq8bejw2cxo') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(0, 2, 'tinytable_css_47l0idi7qoq8bejw2cxo') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(0, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(1, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(2, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(3, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(4, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(5, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(6, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(7, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(8, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(9, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(10, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(11, 0, 'tinytable_css_3rsb3ewxrb2tl0k6wedc') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(0, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(1, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(2, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(3, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(4, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(5, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(6, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(7, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(8, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(9, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(10, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(11, 1, 'tinytable_css_b042fpg5xrixzqqf47u3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(0, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(1, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(2, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(3, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(4, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(5, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(6, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(7, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(8, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(9, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(10, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(11, 2, 'tinytable_css_2ttxj0zr8l0ayki1n2x3') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(8, 0, 'tinytable_css_97kpfwk4hlnf1srl341l') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(8, 1, 'tinytable_css_97kpfwk4hlnf1srl341l') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(8, 2, 'tinytable_css_97kpfwk4hlnf1srl341l') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(3, 1, 'tinytable_css_ypelpga08xjbvpx0iqi1') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(4, 1, 'tinytable_css_ypelpga08xjbvpx0iqi1') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(3, 2, 'tinytable_css_d1hk3tczb5urd931iq6m') })
window.addEventListener('load', function () { styleCell_tinytable_qmjia0wjs6d8p2ex5q0h(4, 2, 'tinytable_css_d1hk3tczb5urd931iq6m') })
    </script>

  


</div>
</div>
</section>
<section id="table-captions-and-numbering" class="level2">
<h2 class="anchored" data-anchor-id="table-captions-and-numbering">Table captions and numbering</h2>
<p>One really nice Quarto feature is the ability to automatically generate cross references to figures and tables. To do this, you’ll need to do three things:</p>
<ol type="1">
<li>Add a chunk label using the <code>label</code> option in the chunk options. For tables, you need to use a <code>tbl-</code> prefix; for figures you need to use a <code>fig-</code> prefix.</li>
<li>Add a caption using either the <code>tbl-cap</code> or <code>fig-cap</code> option in the chunk options.</li>
<li>Reference the table or figure in your text by typing <code>@tbl-whatever-your-label-is</code> or <code>@fig-whatever-your-label-is</code></li>
</ol>
<p>Here’s how it all works—type this…</p>
<div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb7-1">Blah blah blah I'm typing about causal inference; see @fig-example.</span>
<span id="cb7-2"></span>
<span id="cb7-3"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{r}</span></span>
<span id="cb7-4"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#| label: fig-example</span></span>
<span id="cb7-5"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#| fig-cap: "This is a histogram"</span></span>
<span id="cb7-6"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#| fig-width: 5</span></span>
<span id="cb7-7"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#| fig-height: 3</span></span>
<span id="cb7-8"></span>
<span id="cb7-9"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">ggplot(mpg, aes(x = hwy)) + </span></span>
<span id="cb7-10"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">  geom_histogram(binwidth = 2, color = "white", fill = "darkorange") +</span></span>
<span id="cb7-11"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">  theme_bw()</span></span>
<span id="cb7-12"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span>
<span id="cb7-13"></span>
<span id="cb7-14">And more blah stuff here, and @tbl-other-example has some results in it.</span>
<span id="cb7-15"></span>
<span id="cb7-16"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{r}</span></span>
<span id="cb7-17"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#| label: tbl-other-example</span></span>
<span id="cb7-18"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#| tbl-cap: "A table with stuff in it"</span></span>
<span id="cb7-19"></span>
<span id="cb7-20"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">mpg |&gt; </span></span>
<span id="cb7-21"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">  select(year, cyl, trans, drv) |&gt; </span></span>
<span id="cb7-22"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">  slice(1:4) |&gt; </span></span>
<span id="cb7-23"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">  tt()</span></span>
<span id="cb7-24"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div>
<p>… to get this:</p>
<div class="border p-4 m-3 shadow">
<p>Blah blah blah I’m typing about causal inference; see Figure&nbsp;1.</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div id="fig-example" class="quarto-figure quarto-figure-center quarto-float anchored" data-fig-align="center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-example-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evalsp24.classes.andrewheiss.com/news/2024-04-09_tables-tinytable-modelsummary_files/figure-html/fig-example-1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:65.0%">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-example-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: This is a histogram
</figcaption>
</figure>
</div>
</div>
</div>
<p>And more blah stuff here, and Table&nbsp;1 has some results in it.</p>
<div class="cell" data-layout-align="center">
<div id="tbl-other-example" class="cell quarto-float anchored" data-layout-align="center">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-other-example-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: A table with stuff in it
</figcaption>
<div aria-describedby="tbl-other-example-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output-display">
 

  
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>tinytable_e2vxsr0j6r6q3dqvwx37</title>
    <style>
.table td.tinytable_css_jts8gyiema7qqsny09al, .table th.tinytable_css_jts8gyiema7qqsny09al {    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>
    <script>
    MathJax = {
      tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']]
      },
      svg: {
        fontCache: 'global'
      }
    };
    </script>
  

  
    <div class="container">
      <table class="table table-borderless" id="tinytable_e2vxsr0j6r6q3dqvwx37" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing="true">
        <thead>
        
              <tr>
                <th scope="col">year</th>
                <th scope="col">cyl</th>
                <th scope="col">trans</th>
                <th scope="col">drv</th>
              </tr>
        </thead>
        
        <tbody>
                <tr>
                  <td>1999</td>
                  <td>4</td>
                  <td>auto(l5)  </td>
                  <td>f</td>
                </tr>
                <tr>
                  <td>1999</td>
                  <td>4</td>
                  <td>manual(m5)</td>
                  <td>f</td>
                </tr>
                <tr>
                  <td>2008</td>
                  <td>4</td>
                  <td>manual(m6)</td>
                  <td>f</td>
                </tr>
                <tr>
                  <td>2008</td>
                  <td>4</td>
                  <td>auto(av)  </td>
                  <td>f</td>
                </tr>
        </tbody>
      </table>
    </div>

    <script>
      function styleCell_tinytable_j8p5buc5b1gc5t1lp8qt(i, j, css_id) {
        var table = document.getElementById("tinytable_e2vxsr0j6r6q3dqvwx37");
        table.rows[i].cells[j].classList.add(css_id);
      }
      function insertSpanRow(i, colspan, content) {
        var table = document.getElementById('tinytable_e2vxsr0j6r6q3dqvwx37');
        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;
      }
      function spanCell_tinytable_j8p5buc5b1gc5t1lp8qt(i, j, rowspan, colspan) {
        var table = document.getElementById("tinytable_e2vxsr0j6r6q3dqvwx37");
        const targetRow = table.rows[i];
        const targetCell = targetRow.cells[j];
        for (let r = 0; r < rowspan; r++) {
          // Only start deleting cells to the right for the first row (r == 0)
          if (r === 0) {
            // Delete cells to the right of the target cell in the first row
            for (let c = colspan - 1; c > 0; c--) {
              if (table.rows[i + r].cells[j + c]) {
                table.rows[i + r].deleteCell(j + c);
              }
            }
          }
          // For rows below the first, delete starting from the target column
          if (r > 0) {
            for (let c = colspan - 1; c >= 0; c--) {
              if (table.rows[i + r] && table.rows[i + r].cells[j]) {
                table.rows[i + r].deleteCell(j);
              }
            }
          }
        }
        // Set rowspan and colspan of the target cell
        targetCell.rowSpan = rowspan;
        targetCell.colSpan = colspan;
      }

window.addEventListener('load', function () { styleCell_tinytable_j8p5buc5b1gc5t1lp8qt(0, 0, 'tinytable_css_jts8gyiema7qqsny09al') })
window.addEventListener('load', function () { styleCell_tinytable_j8p5buc5b1gc5t1lp8qt(0, 1, 'tinytable_css_jts8gyiema7qqsny09al') })
window.addEventListener('load', function () { styleCell_tinytable_j8p5buc5b1gc5t1lp8qt(0, 2, 'tinytable_css_jts8gyiema7qqsny09al') })
window.addEventListener('load', function () { styleCell_tinytable_j8p5buc5b1gc5t1lp8qt(0, 3, 'tinytable_css_jts8gyiema7qqsny09al') })
    </script>

  


</div>
</div>
</figure>
</div>
</div>
</div>


</section>

 ]]></description>
  <category>resources</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_tables-tinytable-modelsummary.html</guid>
  <pubDate>Tue, 09 Apr 2024 22:40:00 GMT</pubDate>
</item>
<item>
  <title>Helpful extra resources on causal inference and dplyr</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_ate-group-by-summarize-resources.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi again everyone!</p>
<p>I recently posted a couple blog posts with some extra details and resources about core concepts in the class. You should check them out!</p>
<ul>
<li><a href="https://www.andrewheiss.com/blog/2024/04/04/group_by-summarize-ungroup-animations/">Visualizing {dplyr}’s <code>mutate()</code>, <code>summarize()</code>, <code>group_by()</code> and <code>ungroup()</code> with animations</a> - I made some little animations showing what happens when you group, summarize, and mutate</li>
<li><a href="https://www.andrewheiss.com/blog/2024/03/21/demystifying-ate-att-atu/">Demystifying causal inference estimands: ATE, ATT, and ATU</a> - This is a helpful little exploration of the ATE, ATT, and ATU—those things that we talked about weeks ago at the beginning of the semester but haven’t really done a lot with since.</li>
</ul>



 ]]></description>
  <category>resources</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_ate-group-by-summarize-resources.html</guid>
  <pubDate>Tue, 09 Apr 2024 18:30:00 GMT</pubDate>
</item>
<item>
  <title>Exam 2 details</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_exam-2.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>Exam 2 opens on Thursday morning and will be available until 11:59 PM on April 19. It’s like Exam 1—open book, open note, open internet, just not open other people. <a href="../resource/exam2.html">There’s a study guide here</a>.</p>
<p>You should have access to all the answer keys after you submit each assignment. If you submitted an assignment to me via e-mail, let me know and I can make the answer key available to you.</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_exam-2.html</guid>
  <pubDate>Tue, 09 Apr 2024 18:13:00 GMT</pubDate>
</item>
<item>
  <title>Catching up + final deadlines + answer keys</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_end-of-semester-things.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>A few quick important announcements for these last few weeks of the semester:</p>
<ul>
<li>I (finally!) just updated your grades for everything turned in to iCollege so far. Please check your grades to make sure I’m not missing anything!</li>
<li>You can still turn stuff in late! I’ve been, like, super lenient about late penalties (despite what I said in the syllabus), so you can still make up missing work</li>
<li>You can turn work in up until <strong>Friday, April 26 at 11:59 PM</strong>—the Friday before the final project is due. That’s the final final deadline for all assignments that aren’t the final project.</li>
</ul>
<p>And remember, <em>please</em> reach out for help if you’re struggling! Don’t suffer in silence—I’m here to help you!</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-04-09_end-of-semester-things.html</guid>
  <pubDate>Tue, 09 Apr 2024 18:03:00 GMT</pubDate>
</item>
<item>
  <title>Extra causal inference resources</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-03-12_extra-causal-inference-resources.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>I hope you’re all enjoying spring break and this beautiful Atlanta weather!</p>
<p>I just wanted to point out some really helpful resources and extra guides for all the causal inference methods we’ve been talking about this semester. There are a couple overarching organizations that focus on evidence-based policy that provide a ton of excellent free resources:</p>
<section id="evidence-in-governance-and-politics-egap" class="level3">
<h3 class="anchored" data-anchor-id="evidence-in-governance-and-politics-egap">Evidence in Governance and Politics (EGAP)</h3>
<p><a href="https://egap.org/">EGAP</a> is a political science-focused evidence-based workgroup that sets standards for research and program evaluation (like creating best practices for preregistration), <a href="https://egap.org/policy-briefs/">publishes policy briefs on causal work</a>, and (most importantly for our class) provides a ton of <a href="https://egap.org/methods-guides/">guides and resources</a> for causal inference.</p>
<p>Make sure you check out their <a href="https://egap.org/methods-guides/">Methods Guide</a> section, where you’ll find a bunch of brief and accessible “10 Things to Know About X” guides, like these:</p>
<ul>
<li><a href="https://egap.org/resource/10-strategies-for-figuring-out-if-x-caused-y/">“10 Strategies for Figuring Out if X Caused Y”</a></li>
<li><a href="https://egap.org/resource/10-things-to-know-about-causal-inference/">“10 Things to Know About Causal Inference”</a></li>
<li><a href="https://egap.org/resource/10-things-to-know-about-hypothesis-testing/">“10 Things to Know About Hypothesis Testing”</a></li>
<li><a href="https://egap.org/resource/10-things-to-know-about-reading-a-regression-table/">“10 Things to Know About Reading a Regression Table”</a></li>
<li><a href="https://egap.org/resource/10-things-to-know-about-pre-analysis-plans/">“10 Things to Know About Pre-Analysis Plans”</a></li>
</ul>
<p>You already saw one of these back in <a href="../content/06-content.html">the readings for week 6</a> (the “10 Things to Know About Statistical Power” guide), but there are lots of others that you should check out and reference in the future.</p>
</section>
<section id="abdul-latif-jameel-poverty-action-lab-j-pal" class="level3">
<h3 class="anchored" data-anchor-id="abdul-latif-jameel-poverty-action-lab-j-pal">Abdul Latif Jameel Poverty Action Lab (J-PAL)</h3>
<p><a href="https://www.povertyactionlab.org/">J-PAL</a> is a economics-focused evidence-based workgroup that focuses on international development interventions (its founders Esther Duflo and Abhijit Banerjee <a href="https://www.povertyactionlab.org/updates/j-pal-co-founders-abhijit-banerjee-and-esther-duflo-awarded-nobel-memorial-prize-1">won the Nobel Prize in Economics in 2019</a>). Similar to EGAP’s policy briefs, they publish short <a href="https://www.povertyactionlab.org/policy-insights">“Policy Insights”</a> summarizing the best evidence on specific policies like education, crime, gender, health, and so on.</p>
<p>Importantly for our class, they also have a big library of <a href="https://www.povertyactionlab.org/research-resources">research resources</a> with step-by-step guides to planning, designing, running, and analyzing projects.</p>
<p>For instance, check out the <a href="https://www.povertyactionlab.org/resource/data-analysis">“Data analysis”</a> guide, which contains R and Stata code for finding different treatment effects (ATE, ATT, ITT, LATE), as well as short, accessible explanations of what those all are.</p>


</section>

 ]]></description>
  <category>resources</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-03-12_extra-causal-inference-resources.html</guid>
  <pubDate>Tue, 12 Mar 2024 16:44:00 GMT</pubDate>
</item>
<item>
  <title>Back to normal!</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-02-14_normal-class-tomorrow.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>I’m like 90% better, so we’re back to our normal schedule tomorrow. We <em>will</em> have an in-person lab tomorrow evening. Be prepared to talk all about DAGs and potential outcomes and causal inference!</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-02-14_normal-class-tomorrow.html</guid>
  <pubDate>Thu, 15 Feb 2024 02:24:00 GMT</pubDate>
</item>
<item>
  <title>Oof, no class :(</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-02-08_no-class-today.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>I was hoping I’d be able to run the in-class lab this evening over Webex, but lol nope. I’m wiped out and can barely talk.</p>
<p>This sucks because we were going to talk about important DAG stuff and answer all your questions about causal models and do an activity where we created both a logic model and a DAG for a program (since they’re very different things with different purposes). We’ll do that all next week instead.</p>
<p>Accordingly, I’ve changed the deadline for the causal model assignment that would be due next week. In order to give you time to get your questions answered about DAGs, <strong>the causal model assignment is due on February 22 now</strong>. I’ve changed the deadline on the class website and on iCollege.</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-02-08_no-class-today.html</guid>
  <pubDate>Thu, 08 Feb 2024 18:10:00 GMT</pubDate>
</item>
<item>
  <title>Important! Another change of plans tomorrow!</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-02-07_covid-class-tomorrow.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>Despite our best efforts, we’ve had a bit of a COVID outbreak at home, and I unfortunately just tested positive this morning.</p>
<p>So sadly, like last week, there will be <strong>no in-person session tomorrow</strong>. Depending on how I’m feeling, I’ll run the in-person lab on Webex again, like last week. I’ll make that call tomorrow afternoon—I’ll let you all know by 2 PM.</p>
<p>So <strong>no</strong> in-person stuff tomorrow evening, but <strong>maybe</strong> synchronous online stuff tomorrow evening.</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-02-07_covid-class-tomorrow.html</guid>
  <pubDate>Wed, 07 Feb 2024 15:59:00 GMT</pubDate>
</item>
<item>
  <title>Important! Change of plans tomorrow!</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-31_class-online-tomorrow.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>Despite our constant masking and careful social interactions, one of my daughters just tested positive for COVID this evening. Out of an abundance of caution (and because kids are little germ factories and it’s inevitable that the others will start testing positive soon), I’m not going to hold the in-person lab tomorrow—I don’t want to inadvertently get any of you sick in case I asymptomatically have it too.</p>
<p>I’m not leaving you content-less though! I’ll run the lab on Webex from my home tomorrow at the usual class time using the same Webex link that we use for streaming from my middle-of-the-classroom laptop. The link is accessible on iCollege in the top navigation bar under “Webex”. We’ll talk about your questions, we’ll work a bit more on regression stuff, and we’ll work through another example of a logic model and compare and contrast it to a DAG.</p>
<p>So <strong>no</strong> in-person stuff tomorrow evening, but <strong>yes</strong> synchronous online stuff tomorrow evening.</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-31_class-online-tomorrow.html</guid>
  <pubDate>Thu, 01 Feb 2024 03:17:00 GMT</pubDate>
</item>
<item>
  <title>Zeroes in the gradebook</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-31_zeroes-gradebook.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>One quick note about your grades on iCollege. A few of you have noticed that you now have 0s for assignments that you haven’t turned in yet. Don’t worry! I just had iCollege update all the missing grades to 0 for the sake of more accurate grade calculation. Before today, if you checked your grades on iCollege, you’d be failing even if you turned in everything and got 100% on everything. That’s because the denominator was 930 points—the total number of points you can get this semester. But that’s inaccurate—we’ve only a handful of things so far (weekly check-ins 1, 2, 3, and problem set 1), so if you got the maximum score on those, you’d have a 60/930, or a 6.5% F. That’s not useful information! There’s no use including those in the denominator for now.</p>
<p>So now you should be able to see what your current grade is with the correct denominator (i.e.&nbsp;the points for everything from the beginning of the semester up to today, which is just 60 points), meaning the percentages you see are more accurate.</p>
<p>If you have a 0, don’t worry! Once you turn in past exercises the 0 will get replaced with the actual score. <a href="../syllabus.html#late-work">You can still turn in late work</a>! The 0 is just a mathematical quirk to get iCollege to cooperate.</p>



 ]]></description>
  <category>course details</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-31_zeroes-gradebook.html</guid>
  <pubDate>Wed, 31 Jan 2024 16:51:00 GMT</pubDate>
</item>
<item>
  <title>The 30-minute rule and how to ask for help</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-11_reaching-out-when-stuck.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>When working through the examples or problem sets, you will get stuck. It’s inevitable.</p>
<p>You <strong>absolutely</strong> can (and should) reach out when stuck. I’m super responsive on Slack and e-mail. If you ask a question on the #help channel in Slack, others can help too. No question is too tricky or embarrassing, I promise. Computers are extraordinarily literal and tiny typos will often mess you up for a long time—I’ve lost countless time because of missing commas and misspelled words (curse you <code>lenght()</code>). Please feel comfortable reaching out.</p>
<p>I’m a big believer in the 30-minute rule:</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
The 30-minute rule
</div>
</div>
<div class="callout-body-container callout-body">
<p>If you’re stuck on an issue for more than 30 minutes, <strong>stop</strong>, take a break, and ask for help somewhere.</p>
</div>
</div>
<p>There are a few easy guidelines to remember when asking for help:</p>
<ol type="1">
<li><p>Be kind.</p></li>
<li><p>Ask questions with as complete information as possible. <strong>Do not</strong> just post a photo from your phone and say something like “help?” or “my code isn’t working” and that’s it—provide more background (it’s hard to read your computer’s mind).</p>
<p>Some people call this <a href="https://chriscoyier.net/2022/12/28/watch-out-for-low-resolution-writing/">low resolution writing vs.&nbsp;high resolution writing</a>. With low resolution writing on Slack, you’d type “My code isn’t working,” and then you’ll have to wait for someone to respond with “What isn’t working?,” and then you’ll respond with “My code for question 3,” and then you’ll have to wait for someone to respond with “What part of question 3?” and so on and it can take forever. Avoid this where possible. Embrace high resolution writing instead. Have your initial message be something like “In question 3 of the problem set, I’m trying to run a regression model that includes income as an independent variable. I’m running this code (CODE HERE), but I’m getting an error that says (ERROR HERE).” You’ll get help way faster that way.</p>
<p>Explain specifically what you’re trying to do and provide code when possible. You can actually format R code on Slack if you click on the little lightning icon in the bottom left of the typing area and search for “text snippet”—that’ll open a dialog that will let you paste in text and add R syntax highlighting. You can also paste your code between triple backticks on Slack and it’ll format it in monospaced font (though not with the neat syntax highlighting that you get when using Slack’s text snippet thing):</p>
<div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode default code-with-copy"><code class="sourceCode default"><span id="cb1-1">```</span>
<span id="cb1-2">ggplot(blah) + geom_point()</span>
<span id="cb1-3">```</span></code></pre></div>
<p>You can also take screenshots to <em>supplement</em> your question (use ⌘+shift+4 on macOS to save a screenshot to your Desktop, or ⌘+⌥+shift+4 to save a screenshot directly to the clipboard; use Windows+shift+S on Windows to save a screenshot directly to the clipboard). Do not send a screenshot as your entire question though (it’s very tempting to just post a picture of an error and hope that someone can fix it)—provide context. Screenshots are helpful, but code/text is better—it’s harder for people to get the code out of a screenshot in Slack and into RStudio on their computer to troubleshoot, since you can’t copy/paste from an image.</p></li>
<li><p>Try making your question a <strong>repr</strong>oducible <strong>ex</strong>ample (or reprex). Reprexes are the best way to (1) get help online and (2) fix issues on your own.</p>
<p>Making a good reprex is tricky, but it’s a very valuable skill to know (regardless of programming language!). Here are some helpful resources for making them:</p>
<ul>
<li><i class="fa-solid fa-arrow-up-right-from-square" aria-label="arrow-up-right-from-square"></i> <a href="https://community.rstudio.com/t/faq-whats-a-reproducible-example-reprex-and-how-do-i-do-one/5219">What’s a reproducible example (<code>reprex</code>) and how do I do one?</a></li>
<li><i class="fa-solid fa-arrow-up-right-from-square" aria-label="arrow-up-right-from-square"></i> <a href="https://www.jessemaegan.com/post/so-you-ve-been-asked-to-make-a-reprex/">So you’ve been asked to make a reprex</a></li>
<li><i class="fa-brands fa-r-project" aria-label="r-project"></i> <a href="https://reprex.tidyverse.org/index.html">The reprex package</a></li>
</ul></li>
<li><p>Ask in public. It is very tempting to send me private messages on Slack for assistance, and that’s great and I’m happy to respond like that. However, one way to help <a href="../news/2024-01-11_building-community.html">build a stronger community</a> for this class is to ask questions in public in the different <code>#help</code> channels instead. There are a couple reasons for this:</p>
<ul>
<li><strong>It reduces duplication</strong>: Many of you will have almost identical questions and I often end up copying and pasting my answers between different private conversations asking for help. Having those questions and answers in the public <code>#help</code> channels instead will let you get answers to common questions faster</li>
<li><strong>It allows <em>you</em> to help</strong>: Some of you have R experience already, and even if you don’t, as the semester goes on, you’ll get more comfortable with it and will start being able to answer your classmates’ questions. You might have just fixed a similar issue in a past exercise, or you might be able to spot a typo in their code, or you might otherwise know how to help. Step in and help! Slack is for building a community, not just for getting assistance from me.</li>
</ul></li>
</ol>
<p>And that’s it. <strong>Ask questions in ways that will help answerers answer them and be nice about it. When answering questions, be nice about it. Ask lots of questions. Answer lots of questions. Do it all in public.</strong></p>
<p>Once again, <em>do not suffer in silence</em>. I’ve had past students tell me that’s like the one thing they’ll remember from my classes—do not suffer in silence. I mean it, and I’ll keep saying it throughout the semester (because often in your past courses and degrees, you’ve been discouraged from reaching out or from building communities or whatever—that is <em>not</em> the case here).</p>
<p>Remember that you can always sign up for a time to meet with me at <a href="https://calendly.com/andrewheiss/">my Calendly page</a>! I’m also on Slack and accessible via e-mail!</p>



 ]]></description>
  <category>advice</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-11_reaching-out-when-stuck.html</guid>
  <pubDate>Thu, 11 Jan 2024 14:46:00 GMT</pubDate>
</item>
<item>
  <title>Building community</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-11_building-community.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>The most common question from the pre-class survey was some variation of this:</p>
<blockquote class="blockquote">
<p>I have no background in programming or in R—will I be able to learn things and succeed in this class?</p>
</blockquote>
<p>Absolutely.</p>
<p>I’ve designed this class to be accessible by people with any level of R experience. If you’ve never used R—awesome! If you’ve been using R for years—awesome! You’ll all learn new skills.</p>
<p>To get the most out of this class and minimize the inevitable frustration that comes with learning a programming language, <strong>do not try to do everything on your own</strong>. Community is essential.</p>
<section id="class-community" class="level3">
<h3 class="anchored" data-anchor-id="class-community">Class community</h3>
<p>Throughout these pandemic years I’ve been studying the research on online and hybrid teaching to see how to make my classes as successful as possible. One almost universal key to success I’ve found is that learning requires social interaction to be successful <span class="citation" data-cites="Glazier:2016">(Glazier 2016)</span>. In fact, <strong>one of the greatest predictors of success is whether students build relationships with their classmates and their professor.</strong></p>
<p>This is true for <strong>both</strong> online classes and face-to-face classes! It’s entirely possible to take a face-to-face class and have almost no social interaction. The worst, most useless class I ever took as an undergraduate was a required Intro to US History class that met twice a week for 2 hours in a massive auditorium with 900 (!!!) other students. It was awful and I learned nothing.</p>
<p>So, interact with me and your classmates! Don’t lurk in silence in the shadows. <em>Do</em> reach out and talk to your classmates (and me!).</p>
<p>To that end, one of the best ways to get to know each other is to help each other. Ask questions on Slack. If you see someone’s question there and you know how to help, answer!</p>
<p>You can also work on problem sets in groups if you want. Use Webex or Zoom to share screens with each other during calls so you can see what you’re doing. In the real programming world, a common technique for working on code is <a href="https://en.wikipedia.org/wiki/Pair_programming">pair programming</a>, where two people work on the same script. We will occasionally do this in our in-person sessions. <strong>Feel free to replicate that experience</strong> and work with others. It’s not cheating! (As long as you don’t turn in identical work)</p>
</section>
<section id="online-community" class="level3">
<h3 class="anchored" data-anchor-id="online-community">Online community</h3>
<p>One of the great parts about the online R community is that the team at Posit has actually hired people to help promote community norms. Like that’s their whole job—community evangelist. The R world is probably one of the nicest corners of the programming internet because of these norms—there’s an emphasis on helping beginners, being kind and respectful, and cheerfully helping as much as possible. Watch the <code>#rstats</code> hashtag on <a href="https://twitter.com/hashtag/rstats">Twitter</a> and Mastodon, look at the “r” tag on StackOverflow, and look at discussions at the <a href="https://community.rstudio.com/">Posit Community</a> and you’ll see kindness in action.</p>
<p>This was not always the case. 10ish years ago, before the RStudio people made a concerted effort to create community, the online R world was pretty mean and toxic, with forums run by a few really grumpy statisticians who’d belittle you if you asked a poorly worded question. It was awful. That kind of attitude often still persists in other languages (hooo boy try asking a beginner question about Python at StackOverflow 😬), but the R world has tried really hard to be welcoming.</p>
<p>I embrace that attitude when teaching R, and I encourage you all to do the same. Reach out for help early and often. Do not suffer in silence. Do not spend hours and hours stuck on an issue before reaching out for help.</p>
<hr>
<p>Help make this semester fantastic by talking, reaching out, and otherwise socially interacting!</p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-Glazier:2016" class="csl-entry">
Glazier, Rebecca A. 2016. <span>“Building Rapport to Improve Retention and Success in Online Classes.”</span> <em>Journal of Political Science Education</em> 12 (4): 437–56. <a href="https://doi.org/10.1080/15512169.2016.1155994">https://doi.org/10.1080/15512169.2016.1155994</a>.
</div>
</div></section></div> ]]></description>
  <category>advice</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-11_building-community.html</guid>
  <pubDate>Thu, 11 Jan 2024 14:41:00 GMT</pubDate>
</item>
<item>
  <title>Copy, paste, and tweak</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-11_copy-paste-tweak.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Learning programming is a little different from learning other skills or materials. In other classes you’ve taken, you read articles or textbooks, take notes on them, talk about the readings in class, maybe complete problem sets or exercises about the materials, and then you take a test.</p>
<p>With programming, though, the approach is typically different. You read things, you copy code, you paste that code into a file on your computer, and you tinker with the code to see how it works and what changes as you change things.</p>
<p>The R community in particular has embraced this approach to learning how to code. Posit, the company that develops RStudio, <a href="https://education.rstudio.com/">has a whole team of professional educators</a> dedicated to improving R pedagogy, and they use this approach in all their teaching materials. The <a href="https://software-carpentry.org/">Software Carpentry project</a> (a group dedicated to teaching data and programming skills) does too. I’m a fan of it as well. <a href="https://moderndive.com/1-getting-started.html#tips-code">As one of the textbooks I teach from in another class states</a>:</p>
<blockquote class="blockquote">
<p><strong>Take the “copy, paste, and tweak” approach</strong>: Especially when you learn your first programming language or you need to understand particularly complicated code, it is often much easier to take existing code that you know works and modify it to suit your ends. This is as opposed to trying to type out the code from scratch. We call this the “<em>copy, paste, and tweak”</em> approach. So early on, we suggest not trying to write code from memory, but rather take existing examples we have provided you, then copy, paste, and tweak them to suit your goals. After you start feeling more confident, you can slowly move away from this approach and write code from scratch. Think of the “copy, paste, and tweak” approach as training wheels for a child learning to ride a bike. After getting comfortable, they won’t need them anymore.</p>
</blockquote>
<p>To make your copying/pasting life easier, each topic has an <a href="../example/index.html">extensive example page</a> and an accompanying video showing how to work through the different analyses. Copy/paste/tweak liberally from the example pages!</p>
<p>Every chunk of code on the course website has a neat little <i class="fa-solid fa-clipboard" aria-label="clipboard"></i> clipboard icon that you can use to copy the whole chunk:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Click on the clipboard icon in the top right corner → to copy this code</span></span>
<span id="cb1-2">x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb1-3">x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb1-4"><span class="do" style="color: #5E5E5E;
background-color: null;
font-style: italic;">## [1]  6  7  8  9 10</span></span></code></pre></div>
</div>
<p>Use that button!</p>
<p>Inevitably in the classes where I teach R, I have students say things like “I’m trying to do this without looking at any documentation!” or “I can’t do this without googling—I’m a failure!”. While the effort to be fully independent and perfect with code is noble, it’s <em>totally unnecessary</em>. Everyone looks stuff up all the time—being able to do something without looking stuff up shouldn’t be your end goal.</p>
<p>Eventually you’ll be able to whip out basic <code>ggplot(..., aes(...)) + geom_point() + geom_smooth() + labs()</code> kinds of things without copying and pasting—that comes naturally over time, and you see me do that in the videos. But as soon as I have to start changing axis breaks or do anything beyond the standard stuff, I immediately start googling and looking at the documentation. Everyone does it. The authors of these packages do it. That’s why documentation exists. So don’t feel bad if you do it too. It’s the dirty little secret of all programming everywhere—it’s impossible to write code without referring to documentation or other people’s code (or your past code).</p>
<p>This is why I have you do stuff in Quarto Markdown. Everything in your problem sets is completely reproducible. The document tells you exactly what you ran to get the data and results and figures that you made. Copy and paste from your past assignments liberally. Copy and paste from the examples liberally.</p>
<p>Do <strong>not</strong> be super noble and force yourself to write everything from scratch!</p>
<p>Finally, if you ever get frustrated when running code or making a plot because it goes wild and vomits geoms all over the page, don’t worry! It happens to everyone! There’s actually a whole hashtag on Twitter for #accidentalaRt (and a corresponding <a href="https://twitter.com/accidental__aRt">@accidental__aRt</a> Twitter account that collects these plots) where people post their plotting disasters. Scroll through the feed and see the marvelous accidental art people make. It’s fantastic.</p>



 ]]></description>
  <category>advice</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-11_copy-paste-tweak.html</guid>
  <pubDate>Thu, 11 Jan 2024 14:37:00 GMT</pubDate>
</item>
<item>
  <title>Plan for the first day of class</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-10_first-day-plans.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hi everyone!</p>
<p>Tomorrow’s the first day of class! Exciting!</p>
<p>Since we’re still in a pandemic, I’ve structured the class in way that limits our exposure to each other as much as possible. <a href="../syllabus.html#course-structure">As noted in the syllabus</a>, we’re using a flipped classroom this semester. What this means in practice is that you’ll do all the readings <em>and</em> watch asynchronous lecture videos before class meets on Thursdays.</p>
<p>Our in-person time will <strong>not</strong> involve lectures. Instead, it’ll be a more hands-on lab for working with R and answering the questions that come up from doing the readings and watching the lectures. That’s the point of the <a href="../assignment/weekly-check-in.html">weekly check-in assignment</a>—the only way this in-person time will be effective is if you do the readings + videos and ask questions in the weekly check-in.</p>
<p>The <a href="../content/01-content.html">videos for the first day of class are live and ready to watch</a> (along with the readings). If possible, please watch them (and do the readings) before class tomorrow so that we can start with the lab-like in-person time and get a good solid introduction to R and RStudio + answer the questions you have from the first session’s materials.</p>
<p>Ideally, please try to submit the first weekly check-in on iCollege by tomorrow too so that we can have some good Q&amp;A time during our in-person time. <a href="https://www.huffingtonpost.co.uk/entry/no-worries-if-not-psychology_uk_60fff90be4b0d017f838bf1a">BUT no worries if not!</a> The first weekly check-in isn’t technically due until next week.</p>
<p>If you don’t have time to get through the materials before the first day, that’s totally fine—you can do it later and there’s no late penalty or anything for the first week. But if you can, let’s get started!</p>



 ]]></description>
  <category>getting started</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-10_first-day-plans.html</guid>
  <pubDate>Thu, 11 Jan 2024 02:20:00 GMT</pubDate>
</item>
<item>
  <title>Announcements and updates</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-04_announcements-updates.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Haha one last thing for real!</p>
<p>Over the course of the semester, I’ll be sending you lots of updates and announcements and FAQs.</p>
<p>My philosophy for this class is to let you maintain access to as much content as possible, which is why so little of the the class material is on iCollege.</p>
<p>I will post all these announcements and e-mails at <a href="../news/index.html">the “News” section</a> of the course website. This means that even after you finish the class and lose access to iCollege, and even after you graduate from GSU and lose access to your gsu.edu e-mail address, you’ll still have a searchable archive of messages and FAQs from this class.</p>
<p>I’ll let you know when there’s a new item in the news section in a few different ways:</p>
<ol type="1">
<li>I’ll e-mail you a link to the newest message. I’ll use the e-mail address you have listed in PAWS—if you want me to use a different address, let me know and I’ll update my list</li>
<li>New messages should post automatically to the #general channel in Slack</li>
<li>If you use an RSS feed reader (RIP Google Reader), you can subscribe to an RSS feed of the news section. There’s a link at the top of <a href="../news/index.html">the news page</a>.</li>
</ol>
<p>Phew. That should be it from me for a while. Remember to read the syllabus and the rest of the course website, answer the welcome survey, sign up for Slack, and join the Posit.cloud workspace. Also, remember to take care of yourselves! I mean <em>every word</em> in <a href="../syllabus.html#learning-during-a-pandemic">the “Learning during a pandemic” section of the syllabus</a>—this all sucks so much, and I will try my hardest to accommodate your needs throughout the semester.</p>
<p>Thanks!</p>



 ]]></description>
  <category>getting started</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-04_announcements-updates.html</guid>
  <pubDate>Thu, 04 Jan 2024 18:54:00 GMT</pubDate>
</item>
<item>
  <title>Important R stuff</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-04_important-r-stuff.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>From reading the syllabus you’ll notice that we’re using R in this class (though you can certainly use Stata too if you really want). R is free (!!), and highly sought after by employers, but it has a little bit of an initial learning curve. You’ll get the hang of it, though, I promise! I’m a certified RStudio instructor (see <a href="https://education.rstudio.com/trainers/" class="uri">https://education.rstudio.com/trainers/</a>), so I’ve been specially trained to teach statistical programming. Again, I promise that you’ll learn a ton.</p>
<p>While R and RStudio are free and open source, they can sometimes be tricky to install. To make life simpler, you can run RStudio in your browser without having to install anything (!!!) using a service called <a href="https://posit.cloud">Posit.cloud</a>. Over the course of the semester you’ll want to eventually install everything on your actual computer, since it’ll run faster there, but you won’t need to install anything to get started. I’ll e-mail you a link to join the class workspace.</p>
<p>In the meantime, you can also install everything on your actual computer if you <a href="../resource/install.html">follow these instructions</a> (eventually you should do this—it’s best to run R on your own computer, but it’s totally fine to run everything at Posit.cloud for the first few weeks)</p>
<p>Once again, I promise that you can do this and have a blast in this class!</p>



 ]]></description>
  <category>getting started</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-04_important-r-stuff.html</guid>
  <pubDate>Thu, 04 Jan 2024 18:52:00 GMT</pubDate>
</item>
<item>
  <title>Welcome to class!</title>
  <link>https://evalsp24.classes.andrewheiss.com/news/2024-01-02_welcome.html</link>
  <description><![CDATA[ 

<div class="back-nav"><a href="../news/">← News</a></div>




<p>Hello everyone!</p>
<p>I’m Andrew Heiss, your professor for PMAP 8521 (Evaluation Research) this spring, and I’m so excited for the class! In this class you’ll learn all about causal inference, or how to legally claim causation with statistics. In your past stats courses you were always taught “correlation isn’t causation,” which is mostly true, except when it’s not. In this class you’ll get to legitimately make causal claims.</p>
<p>We’ll cover fun tools like directed acyclic graphs (DAGs), randomized controlled trials, difference-in-differences analysis, regression discontinuity analysis, and instrumental variables. You’ll also learn the statistical language R, which is free (which means you can keep using it after you graduate and not have to pay for really really expensive SPSS or Stata licenses). I’ve had many former students get jobs because of the R part of this class—tons of public and nonprofit organizations are looking for R skills.</p>
<p>I have a few important announcements before class:</p>
<ul>
<li><p>We are meeting in person, but as you’ll see in the syllabus (see the <a href="../syllabus.html#pandemic-stuff">“Masking and vaccines” section</a> there, I’m trying to take as many precautions as possible since there’s still a global pandemic. For instance…</p></li>
<li><p>…I’ve made the course a flipped course, which means you’ll do all the readings and watch the lectures on YouTube <em>before</em> class on Thursdays (<a href="../syllabus.html#course-structure">see here for more details</a>). We’ll spend our class time answering questions, doing activities, and learning a lot of R together. This means that the bulk of the course material is fully online and asynchronous.</p></li>
<li><p>Before class, I’d love to get to know each you a little first, so I’ve created a quick survey to fill out. I’ve sent you a link to it via e-mail. Please take it at your earliest convenience.</p></li>
<li><p>The entire course is available at a special class website at <a href="https://evalsp24.classes.andrewheiss.com/" class="uri">https://evalsp24.classes.andrewheiss.com/</a> (surprise—you’re at it right now). Bookmark this site—it’ll be your best friend for the next semester. I only use iCollege for collecting your assignments, posting answer keys, posting a couple scanned book chapters, and offering the two exams (since it’s password protected). This website is the official source of dates and all other class information. Because it’s not part of iCollege, you’ll be able to reference it even after you graduate and lose access to GSU resources. You can even share it with others—it’s just a website!</p></li>
<li><p><strong>Please read the main explanatory pages at the course website at your earliest convenience.</strong> The instructions and expectations for the class are divided across different pages, all accessible from the menu bar at the top of the site. Please read the main pages for the <a href="../syllabus.html">syllabus</a>, <a href="../schedule.html">schedule</a>, <a href="../content/index.html">content</a>, <a href="../assignment/index.html">assignments</a>, and <a href="../example/index.html">examples</a>.</p></li>
<li><p>We’re using zero physical textbooks in this class. Every reading and book and piece of software in this class is 100% <strong>free</strong> (<a href="../syllabus.html#course-materials">see the syllabus for more information about that</a>).</p></li>
</ul>
<p>Quick background about me: I’m an assistant professor here at the Andrew Young School, where I’ve been teaching MPA/MPP microeconomics, program evaluation, and data visualization. I moved here from Utah in Fall 2019, where I was a visiting professor of public management at the Marriott School of Business at Brigham Young University (BYU). While at BYU, I taught microeconomics, statistics, and data visualization (basically the same stuff I’m teaching now). I finished my PhD in public policy and political science from Duke in 2017, and before then I finished my MPA in nonprofit management from BYU in 2012. When I’m not teaching, I research international nonprofits and human rights.</p>
<p>When I’m not teaching stats and evaluation, I research international nonprofits and political science. And when I’m not teaching or researching, I’m normally chilling at home with my 6 (!!) kids (see <a href="https://www.heissatopia.com/" class="uri">https://www.heissatopia.com/</a> for photos and hilarious stories).</p>
<p>Again, I’m really excited to get started next week. This semester should be a blast!</p>



 ]]></description>
  <category>getting started</category>
  <guid>https://evalsp24.classes.andrewheiss.com/news/2024-01-02_welcome.html</guid>
  <pubDate>Thu, 04 Jan 2024 16:59:00 GMT</pubDate>
</item>
</channel>
</rss>
