- Illumined Insights
- Posts
- Esquisse: A must-have data visualization package for R
Esquisse: A must-have data visualization package for R
Harness the power of ggplot2 with esquisse: An interactive and user-friendly data visualization tool
Welcome to the “Illumined Insights” newsletter! Thank you so much for subscribing. This weekly newsletter touches on all things analytics and data science with a focus on areas such as data visualization, sports analytics, and AI. We kick off the newsletter with an overview of one of my favorite R packages, the “esquisse” package for data visualization.
Stephen Hill, Ph.D.
Data visualization is an essential aspect of data analysis and understanding. It allows us to explore and present data in a meaningful and intuitive way. In the R community, there are many libraries and packages available for creating data visualizations, but one package that I have recently been impressed by is the "esquisse" package.
The "esquisse" package is an R package that provides R users a graphical user interface by which "ggplot2" package visualizations can be created. It is a simple and user-friendly tool that can be used by both novice and experienced R users. This interactive approach allows users to quickly iterate through different visualizations and find the best way to present your data. Once satisfied with the “esquisse”-produced “ggplot2” plot, the code to generate the plot is easily exported into an Markdown document, R script, or Quarto document.
Visualizations can also be exported in various file formats, including PNG, PDF, and SVG. This means that users can easily share their visualizations with others and include them in reports and presentations.
Let’s look at how we can use “esquisse” to create a simple visualization. To get started, we need to ensure that we have installed the package in R. As we do with any package in R, we can use the "install.packages" command:
install.packages("esquisse")
Once installed, you can launch the app by running:
library(esquisse)
You should also ensure that the “ggplot2” package is installed and loaded. Code to do this is below:
install.packages("ggplot2")
library(ggplot2)
To access the “esquisse” GUI and build our first plot, run the command:
esquisser()
After running this command, we are greeted with an interface via which we can choose the data that we want to visualize.
The “esquisse” package data selection interface
Next, click on “Select an environment in which to search:” and scroll down to select “ggplot2” under “Packages”. Now we can “ Select a data.frame:”. Let’s choose the classic “diamonds” dataset that contains pricing and other information about a variety of diamonds. Click “Import data”. We now see the “esquisse” drag-and-drop user interface.
The “esquisse” user interface
We can easily create plots by dragging variable names (shown in orange and blue) to the X, Y, etc. fields. For example, to create simple scatterplot with carat and price, drag these variables to X and Y, respectively.
Creating a scatterplot with “esquisse”
When you have completed designing your visualization, you can then export the “ggplot2” code into your R document or directly download the visualization as a PNG, PDF, SVG, JPEG, or PPTX file.
There are far too many “esquisse” features to cover in this newsletter. Give it a try with your favorite dataset in R or check out an online, Shiny application version of the package:
Are you interested in learning more about data visualization using R? Click below to get notified about my upcoming book “Data Visualization in R”.
Each week we’ll feature a dataset that we find interesting, useful, etc. We’ll start this feature with a classic dataset. The Titanic dataset is an “oldie-but-goodie” dataset that was one of the first datasets I worked with as I began to explore various analytics tools and techniques.
Download and explore the Titanic dataset for yourself from Kaggle:
Feedback?
Did you enjoy this week’s newsletter? Do you have a topic, tool, or technique that you would like to see featured in a future edition? I’d love to hear from you!
Feedback?
Support this newsletter with a “coffee” (optional, but appreciated).