20  Intro

Now we’re going to look at the second part of the Data Visualization part : the tables.

There are several packages in R to create tables. Here, we’re going to focus mainly on 2 :

The R packages reactable and reactablefmtr are often used together to create highly interactive and visually appealing tables. 

reactable package

The package reactable generates interactive tables in R based on the “React Table” JavaScript library. It provides out-of-the-box features that are essential for data exploration and presentation in R Markdown or quarto documents and Shiny applications. 

The key features include:

reactablefmtr package

The package reactablefmtr was developed to simplify the often lengthy code required to style reactable tables. It offers a wide range of easy-to-use functions and themes to enhance the appearance and information density of tables. 

The key features include:

We will go through a few examples related to Supply Chain (sales analysis, projected demand, projected coverages) to practice, step by step and learn how to use those 2 packages.

We will also introduce very briefly a few other ones :

We will use the library htmltools to customize our tables, creating some specific functions.

The htmltools R package, developed by Posit (formerly RStudio), provides a comprehensive set of functions for creating, manipulating, and rendering HTML content directly from R. It is essential for customizing the UI of Shiny apps, generating R Markdown or quarto contents, and building HTML components, allowing users to define HTML tags, CSS styles, and JavaScript dependencies efficiently. 

The key features and capabilities include: