Output to gt (table) format

stw_to_table(...)

# S3 method for default
stw_to_table(...)

# S3 method for stw_meta
stw_to_table(meta, ...)

# S3 method for stw_dataset
stw_to_table(dataset, ...)

Arguments

...

additional arguments (not used)

meta

Object with S3 class stw_meta, contains meta-data

dataset

Object with S3 class stw_dataset, a data frame with attached meta-data

Value

A gt table

Examples

stw_to_table(diamonds_meta)
#> <style>html { #> font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif; #> } #> #> #mwlefoodfi .gt_table { #> display: table; #> border-collapse: collapse; #> 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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_title { #> color: #333333; #> font-size: 125%; #> font-weight: initial; #> padding-top: 4px; #> padding-bottom: 4px; #> border-bottom-color: #FFFFFF; #> border-bottom-width: 0; #> } #> #> #mwlefoodfi .gt_subtitle { #> color: #333333; #> font-size: 85%; #> font-weight: initial; #> padding-top: 0; #> padding-bottom: 4px; #> border-top-color: #FFFFFF; #> border-top-width: 0; #> } #> #> #mwlefoodfi .gt_bottom_border { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_column_spanner_outer:first-child { #> padding-left: 0; #> } #> #> #mwlefoodfi .gt_column_spanner_outer:last-child { #> padding-right: 0; #> } #> #> #mwlefoodfi .gt_column_spanner { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> vertical-align: bottom; #> padding-top: 5px; #> padding-bottom: 6px; #> overflow-x: hidden; #> display: inline-block; #> width: 100%; #> } #> #> #mwlefoodfi .gt_group_heading { #> padding: 8px; #> 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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_from_md > :first-child { #> margin-top: 0; #> } #> #> #mwlefoodfi .gt_from_md > :last-child { #> margin-bottom: 0; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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: 12px; #> } #> #> #mwlefoodfi .gt_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #mwlefoodfi .gt_first_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-top-style: solid; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> } #> #> #mwlefoodfi .gt_grand_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_striped { #> background-color: rgba(128, 128, 128, 0.05); #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_footnote { #> margin: 0px; #> font-size: 90%; #> padding: 4px; #> } #> #> #mwlefoodfi .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; #> } #> #> #mwlefoodfi .gt_sourcenote { #> font-size: 90%; #> padding: 4px; #> } #> #> #mwlefoodfi .gt_left { #> text-align: left; #> } #> #> #mwlefoodfi .gt_center { #> text-align: center; #> } #> #> #mwlefoodfi .gt_right { #> text-align: right; #> font-variant-numeric: tabular-nums; #> } #> #> #mwlefoodfi .gt_font_normal { #> font-weight: normal; #> } #> #> #mwlefoodfi .gt_font_bold { #> font-weight: bold; #> } #> #> #mwlefoodfi .gt_font_italic { #> font-style: italic; #> } #> #> #mwlefoodfi .gt_super { #> font-size: 65%; #> } #> #> #mwlefoodfi .gt_footnote_marks { #> font-style: italic; #> font-size: 65%; #> } #> </style> #> <div id="mwlefoodfi" style="overflow-x:auto;overflow-y:auto;width:auto;height:auto;"><table class="gt_table"> #> <thead class="gt_header"> #> <tr> #> <th colspan="4" class="gt_heading gt_title gt_font_normal" style>DIAMONDS</th> #> </tr> #> <tr> #> <th colspan="4" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border" style>Prices of 50,000 round cut diamonds</th> #> </tr> #> </thead> #> <thead class="gt_col_headings"> #> <tr> #> <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1">Name</th> #> <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1">Type</th> #> <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1">Description</th> #> <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1">Levels</th> #> </tr> #> </thead> #> <tbody class="gt_table_body"> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">price</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>price in US dollars ($326--$18,823)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">carat</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>weight of diamond (0.2--5.01)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">cut</td> #> <td class="gt_row gt_left">string</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>quality of the cut (Fair, Good, Very Good, Premium, Ideal)</p> #> </div></td> #> <td class="gt_row gt_left">Fair, Good, Very Good, Premium, Ideal</td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">color</td> #> <td class="gt_row gt_left">string</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>diamond color, from D (best) to J (worst)</p> #> </div></td> #> <td class="gt_row gt_left">D, E, F, G, H, I, J</td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">clarity</td> #> <td class="gt_row gt_left">string</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>a measurement of how clear the diamond is (I1 (worst), SI2, SI1, VS2, VS1, VVS2, VVS1, IF (best))</p> #> </div></td> #> <td class="gt_row gt_left">I1, SI2, SI1, VS2, VS1, VVS2, VVS1, IF</td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">x</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>length in mm (0--10.74)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">y</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>width in mm (0--58.9)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">z</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>depth in mm (0--31.8)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">depth</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>total depth percentage = z / mean(x, y) = 2 * z / (x + y) (43--79)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> <tr> #> <td class="gt_row gt_right" style="font-style: italic;">table</td> #> <td class="gt_row gt_left">number</td> #> <td class="gt_row gt_left"><div class='gt_from_md'><p>width of top of diamond relative to widest point (43--95)</p> #> </div></td> #> <td class="gt_row gt_left"></td> #> </tr> #> </tbody> #> <tfoot class="gt_sourcenotes"> #> <tr> #> <td class="gt_sourcenote" colspan="4">Sources: <a href="http://www.diamondse.info/">DiamondSearchEngine</a>: (<a href="mailto:">email</a>), <a href="https://ggplot2.tidyverse.org/">ggplot2 package</a>: (<a href="mailto:">email</a>)</td> #> </tr> #> </tfoot> #> #> </table></div>