Code
library(tidyverse)
library(magrittr)
library(DT)
library(gt)
library(gtExtras)
library(countrycode)
library(downloadthis)
library(svglite)
<- read_rds("../../../assets/datasets/pinot.rds")
ds
# head(ds)
Brian Cervantes Alvarez
February 20, 2023
April 8, 2025
I transformed and aggregated data from a Pinot wines dataset to compute key metrics such as average and standard deviation of wine points and prices by province, and enhanced the presentation using advanced design principles. I developed interactive, aesthetically pleasing tables with DT and gt, incorporating sparklines and custom themes to clearly visualize trends and facilitate data comprehension. This project underscores my proficiency in data wrangling, innovative visualization, and the application of design techniques to improve the clarity and impact of data communication.
This project aims to explore alternative techniques for designing visually appealing and comprehensible data tables. Traditional Excel spreadsheets often lack readability and visual impact. By incorporating design principles such as color theory, typography, and layout, we aim to create visually striking data tables that effectively convey information. Additionally, we will evaluate innovative software tools and platforms that offer user-friendly options for creating functional and aesthetically pleasing data tables. Enhancing data presentation is crucial for improving interpretation and understanding.
Excel spreadsheets are widely used for organizing and presenting data. However, their conventional format can be tedious and challenging to read, hindering data comprehension. This project seeks to address this limitation by exploring various techniques to design visually appealing and comprehensible data tables.
The primary focus is to create data tables that are not only aesthetically pleasing but also convey information effectively. By employing design principles such as color theory, typography, and layout, we aim to enhance the visual impact and readability of data tables. This will involve experimenting with different combinations of colors, fonts, and arrangement patterns to find the most optimal design choices.
It is crucial to recognize that the presentation of data plays a significant role in its interpretation and understanding. The traditional Excel format often lacks visual cues to highlight key data points or insights. Therefore, this project seeks to explore new and innovative methods of presenting data tables that not only serve their functional purpose but also captivate the audience with their visual appeal.
ds_starter <- ds %>%
mutate(
province = as.factor(province),
price = price,
thetaPointMean = mean(points),
thetaPriceMean = mean(price)
)
ds_starter %>%
arrange(province, year) %>%
select(
Province = province,
Year = year,
Price = price,
Points = points,
Description = description
) %>%
datatable(.,
filter = "bottom",
extensions = "Buttons",
options = list(
dom = "Bfrtip",
buttons = c("copy", "csv", "excel"),
initComplete = JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#131F4F', 'color': '#fff'});",
"}"
)
)
)
fancyTbl <- ds_summary %>%
gt() %>%
# format the numeric output to 3 digit rounding
fmt_number(
columns = c(pointsMean, pointsSD, priceMean, priceSD),
decimals = 3
) %>%
# create nice labels for a few ugly variable names
cols_label(
province = "Province",
pointsMean = "Avg. Points",
pointsSD = "Std. Dev. Points",
priceMean = "Avg. Price",
priceSD = "Std. Dev. Price",
points = "Points Trend",
price = "Price Trend",
) %>%
# Plot the sparklines from the list column
gt_plt_sparkline(points,
type = "ref_median",
same_limit = TRUE
) %>%
gt_plt_sparkline(price,
type = "ref_median",
same_limit = TRUE
) %>%
# use the guardian's table theme
gt_theme_guardian() %>%
# give hulk coloring to the Mean Human Rights Score
gt_hulk_col_numeric(pointsMean) %>%
gt_hulk_col_numeric(priceMean) %>%
# create a header and subheader
tab_header(title = "Province Pinot Wine Summary", subtitle = "Source: Dr. Hendrick") %>%
# attach excel file
tab_source_note(excel_file_attachment)
# save the original as an image
# gtsave(fancyTbl, "table.png")
# show the table themed in accordance with the page
fancyTbl
Province Pinot Wine Summary | ||||||
---|---|---|---|---|---|---|
Source: Dr. Hendrick | ||||||
Province | Avg. Points | Std. Dev. Points | Avg. Price | Std. Dev. Price | Points Trend | Price Trend |
Burgundy | 90.438 | 2.989 | 98.035 | 132.856 | ||
California | 90.517 | 2.831 | 47.465 | 18.553 | ||
Casablanca_Valley | 86.282 | 2.428 | 21.107 | 11.953 | ||
Marlborough | 87.550 | 2.245 | 27.668 | 13.833 | ||
New_York | 87.748 | 2.268 | 25.679 | 9.565 | ||
Oregon | 89.489 | 2.663 | 44.856 | 20.209 | ||
This project highlights the importance of visually appealing and comprehensible data tables as an alternative to Excel. By incorporating design principles and exploring innovative tools, we enhance data presentation and interpretation. It calls for adopting alternative techniques to design data tables. By embracing visually appealing formats, we improve data comprehension, communication, and unlock new possibilities for visualization and analysis.
---
title: "Rating Pinot Wines: Is More Expensive Better?"
author: "Brian Cervantes Alvarez"
description: "Revolutionizing Data Tables: Visual Appeal & Comprehension. Explore techniques for aesthetically pleasing & informative tables. Enhance data presentation with design principles & innovative software."
image: /assets/images/wine.jpeg
date: "2-20-2023"
date-modified: today
bibliography: "bibliography.bib"
nocite: |
@*
format:
html:
code-tools: true
code-fold: true
toc: true
toc-location: right
html-math-method: katex
page-layout: article
execute:
warning: false
message: false
categories: [R, Data Tables]
ai-summary:
banner-title: "Yapper Labs | AI Summary"
model-title: "Model: ChatGPT o3-mini-high"
model-img: "/assets/images/OpenAI-white-monoblossom.svg"
summary: "I transformed and aggregated data from a Pinot wines dataset to compute key metrics such as average and standard deviation of wine points and prices by province, and enhanced the presentation using advanced design principles. I developed interactive, aesthetically pleasing tables with DT and gt, incorporating sparklines and custom themes to clearly visualize trends and facilitate data comprehension. This project underscores my proficiency in data wrangling, innovative visualization, and the application of design techniques to improve the clarity and impact of data communication."
---

## Abstract
This project aims to explore alternative techniques for designing visually appealing and comprehensible data tables. Traditional Excel spreadsheets often lack readability and visual impact. By incorporating design principles such as color theory, typography, and layout, we aim to create visually striking data tables that effectively convey information. Additionally, we will evaluate innovative software tools and platforms that offer user-friendly options for creating functional and aesthetically pleasing data tables. Enhancing data presentation is crucial for improving interpretation and understanding.
## Introduction
Excel spreadsheets are widely used for organizing and presenting data. However, their conventional format can be tedious and challenging to read, hindering data comprehension. This project seeks to address this limitation by exploring various techniques to design visually appealing and comprehensible data tables.
The primary focus is to create data tables that are not only aesthetically pleasing but also convey information effectively. By employing design principles such as color theory, typography, and layout, we aim to enhance the visual impact and readability of data tables. This will involve experimenting with different combinations of colors, fonts, and arrangement patterns to find the most optimal design choices.
It is crucial to recognize that the presentation of data plays a significant role in its interpretation and understanding. The traditional Excel format often lacks visual cues to highlight key data points or insights. Therefore, this project seeks to explore new and innovative methods of presenting data tables that not only serve their functional purpose but also captivate the audience with their visual appeal.
## Advanced Data Tables
```{r}
library(tidyverse)
library(magrittr)
library(DT)
library(gt)
library(gtExtras)
library(countrycode)
library(downloadthis)
library(svglite)
ds <- read_rds("../../../assets/datasets/pinot.rds")
# head(ds)
```
```{r}
ds_starter <- ds %>%
mutate(
province = as.factor(province),
price = price,
thetaPointMean = mean(points),
thetaPriceMean = mean(price)
)
ds_starter %>%
arrange(province, year) %>%
select(
Province = province,
Year = year,
Price = price,
Points = points,
Description = description
) %>%
datatable(.,
filter = "bottom",
extensions = "Buttons",
options = list(
dom = "Bfrtip",
buttons = c("copy", "csv", "excel"),
initComplete = JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#131F4F', 'color': '#fff'});",
"}"
)
)
)
```
```{r}
ds_summary <- ds_starter %>%
group_by(province) %>%
arrange(year) %>%
summarise(
pointsMean = mean(points, na.rm = TRUE),
pointsSD = sd(points),
priceMean = mean(price, na.rm = TRUE),
priceSD = sd(price),
points = list(points),
price = list(price),
.groups = "drop"
)
```
```{r}
excel_file_attachment <- ds_summary %>%
download_this(
output_name = "Pinot_Noir_Summary",
output_extension = ".xlsx", # Excel file type
button_label = "Download Excel",
button_type = "primary", # change button type
)
```
## Adding Trend Lines To Summary Tables
```{r}
#| code-summary: "GT Table Code"
#| code-line-numbers: "|6|9"
fancyTbl <- ds_summary %>%
gt() %>%
# format the numeric output to 3 digit rounding
fmt_number(
columns = c(pointsMean, pointsSD, priceMean, priceSD),
decimals = 3
) %>%
# create nice labels for a few ugly variable names
cols_label(
province = "Province",
pointsMean = "Avg. Points",
pointsSD = "Std. Dev. Points",
priceMean = "Avg. Price",
priceSD = "Std. Dev. Price",
points = "Points Trend",
price = "Price Trend",
) %>%
# Plot the sparklines from the list column
gt_plt_sparkline(points,
type = "ref_median",
same_limit = TRUE
) %>%
gt_plt_sparkline(price,
type = "ref_median",
same_limit = TRUE
) %>%
# use the guardian's table theme
gt_theme_guardian() %>%
# give hulk coloring to the Mean Human Rights Score
gt_hulk_col_numeric(pointsMean) %>%
gt_hulk_col_numeric(priceMean) %>%
# create a header and subheader
tab_header(title = "Province Pinot Wine Summary", subtitle = "Source: Dr. Hendrick") %>%
# attach excel file
tab_source_note(excel_file_attachment)
# save the original as an image
# gtsave(fancyTbl, "table.png")
# show the table themed in accordance with the page
fancyTbl
```
## Conclusion
This project highlights the importance of visually appealing and comprehensible data tables as an alternative to Excel. By incorporating design principles and exploring innovative tools, we enhance data presentation and interpretation. It calls for adopting alternative techniques to design data tables. By embracing visually appealing formats, we improve data comprehension, communication, and unlock new possibilities for visualization and analysis.
## Data References
```{r, echo=FALSE}
knitr::write_bib(names(sessionInfo()$otherPkgs), file = "bibliography.bib")
```