An open API service indexing awesome lists of open source software.

https://github.com/r0mymendez/r-dataframe-styles

Add colors and styles to R DataFrames
https://github.com/r0mymendez/r-dataframe-styles

Last synced: 5 months ago
JSON representation

Add colors and styles to R DataFrames

Awesome Lists containing this project

README

          

# Transform your R Dataframes: Styles, 🎨 Colors, and 😎 Emojis

In this repository, we will explore a method to add 🎨colors and πŸ–ŒοΈstyles in R DataFrames. We will focus on the application of colors and emojis, using approaches similar to the popular conditional formatting commonly used in pivot tables within spreadsheets. Through this strategy, we aim to improve the presentation of our data, making the exploration and understanding of the information not only informative but also visually attractive.

# What libraries can I use to style my R dataframes?
The R libraries used to create this article are as follows:


libraries

| Library | Description |
|-------------------|-----------------------------|
| 1. πŸ” **tidyverse** | It integrates various R libraries for data manipulation, graphics, and analysis, promoting clear and efficient code. |
| 2. πŸ“ **knitr** | Automates the generation of dynamic reports. |
| 3. πŸ“ **kableExtra** | An additional extension that enhances table presentation in R Markdown documents with extra formatting options.|
| 4. πŸ“„ **reactablefrmtr**| Incorporates functions to craft interactive and flexible tables in R, featuring filtering, sorting, and search functionalities.|
| 5. ✏️ **htmltools** | Offers functions to build and manipulate HTML objects in R. |
| 6. πŸ“„ **formattable** | Equipped with functions for formatting and customizing tables in R.|
| 7. πŸ“„ **flextable** | Another library enabling the creation of flexible and customizable tables in R, with advanced formatting options for documents and presentations.|
| 8. πŸ“Š **ggplot2** | Among the most popular R visualization libraries, it produces appealing and comprehensible graphs. |
| 9. 🎨 **viridis** | A R library for creating visually appealing color maps. |

---

These libraries empowered me to employ functions for generating HTML-style representations of DataFrames. This capability enables customization of DataFrame visual appearance during viewing.
The functions employed in the code in this repository facilitate the highlighting, coloring, and formatting of cells based on specific conditions. This makes it effortless to visually identify patterns and trends within datasets.


libraries

---

# πŸš€ R Code

If you wish to review the code, you can explore this [R notebook](https://r0mymendez.github.io/r-dataframe-styles/)
Feel free to check it out and give it a star if you find it helpful! ⭐️

---

[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support%20my%20work-FFDD00?style=flat&labelColor=101010&logo=buy-me-a-coffee&logoColor=white)](https://www.buymeacoffee.com/r0mymendez)