a taste of gt

example prep

Using the exibble data that comes with gt, but I like a more more concrete variable names so doing some prep here:


gt overview

This is the exibble dataset in gt
It is one of six datasets in the package
weight fruit team holiday Dates and Times price id club
schedule appointment
0.11 apricot one 2015-01-15 13:35:00 Jan 1, 2018 2:22 AM €49.95 row_1 grp_a
2.22 banana two 2015-02-15 14:40:00 Feb 2, 2018 2:33 PM €17.95 row_2 grp_a
33.33 coconut three 2015-03-15 15:45:00 Mar 3, 2018 3:44 AM €1.39 row_3 grp_a
444.40 durian four 2015-04-15 16:50:00 Apr 4, 2018 3:55 PM €65,100.00 row_4 grp_a
5,550.00 NA five 2015-05-15 17:55:00 May 5, 2018 4:00 AM €1,325.81 row_5 grp_b
More information is available at ?exibble.

formating

Formatted values: time

Formatted values: date


Error : Problem with `filter()` input `..1`.
x subscript out of bounds
ℹ Input `..1` is `line %in% which_highlight_frame`.

Formatted values: currencies


Error : Problem with `filter()` input `..1`.
x subscript out of bounds
ℹ Input `..1` is `line %in% which_highlight_frame`.

Prepping a pizza menu in four parts

part 1

# A tibble: 5 x 4
# Groups:   type [4]
  type                                                size   sold  income
  <chr>                                               <fct> <int>   <dbl>
1 chicken (pizzas with chicken as a major ingredient) L      4932 102339 
2 chicken (pizzas without any meats whatsoever)       L      5403 104203.
3 classic (classical pizzas)                          L      4057  74518.
4 classic (classical pizzas)                          XXL      28   1007.
5 supreme (pizzas that try a little harder)           L      4564  94258.

part 2

🍕 Pizzas Sold in 2015 🍕
sold income
chicken (pizzas with chicken as a major ingredient)
L 4,932 $102,339.00
chicken (pizzas without any meats whatsoever)
L 5,403 $104,202.70
classic (classical pizzas)
L 4,057 $74,518.50
XXL 28 $1,006.60
supreme (pizzas that try a little harder)
L 4,564 $94,258.50

part 3

🍕 Pizzas Sold in 2015 🍕
sold income
chicken (pizzas with chicken as a major ingredient)
L 4,932 $102,339.00
TOTAL 4,932 $102,339.00
chicken (pizzas without any meats whatsoever)
L 5,403 $104,202.70
TOTAL 5,403 $104,202.70
classic (classical pizzas)
L 4,057 $74,518.50
XXL 28 $1,006.60
TOTAL 4,085 $75,525.10
supreme (pizzas that try a little harder)
L 4,564 $94,258.50
TOTAL 4,564 $94,258.50
GRAND TOTAL 18,984

part 4


🍕 Pizzas Sold in 2015 🍕
sold income
chicken (pizzas with chicken as a major ingredient)
L 4,932 $102,339.00
TOTAL 4,932 $102,339.00
chicken (pizzas without any meats whatsoever)
L 5,403 $104,202.70
TOTAL 5,403 $104,202.70
classic (classical pizzas)1
L 4,057 $74,518.50
XXL2 28 $1,006.60
TOTAL 4,085 $75,525.10
supreme (pizzas that try a little harder)
L 4,564 $94,258.50
TOTAL 4,564 $94,258.50
GRAND TOTAL 18,9843 $376,325.30

1 The pizza category with the highest total sales.

2 Custom sizes for The Greek pizza.

3 This is a new record. Truly, 2015 was a great year for the pizzaplace.