R Esquisse: How to Explore Data in R Through a Tableau-like Drag-and-Drop Interface
R Esquisse is an <a href="https://cran.r-project.org/web/packages/esquisse/vignettes/get-started.html" target="_blank" rel="noopener">R package</a> that provides an intuitive GUI for creating data visualizations using <code>ggplot2</code>. This package is particularly valuable for stakeholders seeking <strong>quick interactive analysis</strong> and <strong>insights gathering </strong>from data sources, whether they are new to R or prefer a more <strong>visual approach to creating plots</strong>. With R Esquisse, you can easily select variables from your data and <strong>drag and drop</strong> them onto a plot canvas, <strong>customize plot features</strong> such as titles, axis labels, colors, and generate <code>ggplot2</code> charts with just a couple of clicks. The interface of R Esquisse is similar to Tableau - a popular data visualization software, making it easy for users who are familiar with Tableau to transition to R Esquisse. The package also offers advanced features such as multi-language support and an in-browser application, which further enhance the user experience. In this article, we will discuss how to <strong>install and import data into R Esquisse</strong>, explore its <strong>basic and advanced features</strong>, and provide <strong>examples of how it can be used</strong> to create stunning data visualizations in R. So, without further delay, let's dive in! <blockquote>Is Tableau better than R Shiny? <a href="https://appsilon.com/tableau-vs-r-shiny/" target="_blank" rel="noopener">Read this article to find out which Excel alternative is right for you</a>.</blockquote> Table of contents: <ul><li><a href="#introduction">What is R Esquisse and How to Install It</a></li><li><a href="#data-import">How to Import Data to R Esquisse</a></li><li><a href="#data-visualization">How to Visualize Data in R Esquisse - Generate ggplot2 Charts</a></li><li><a href="#additional-features">Additional Features - Multi-Language Support and In-Browser Application</a></li><li><a href="#summary">Summing up R Esquisse</a></li></ul> <hr /> <h2>What is R Esquisse and How to Install It</h2> As mentioned in the introduction section, Esquisse is an R package that provides a user-friendly graphical user interface (GUI) for creating data visualizations using the <code>ggplot2</code> package. There really isn't much to say about it, except that it requires no knowledge of <code>ggplot2</code> and that it offers superb R Shiny support. More on Shiny use case in a separate article, since it's too broad of a topic to cover today. To install R Esquisse, you can use the <code>install.packages()</code> function in R, followed by the name of the package in quotation marks. Here's the command you have to run from the R console: <pre><code class="language-r">install.packages("esquisse")</code></pre> This command will install R Esquisse and all of its dependencies. Once installed, you can load the package and click on the <b>Addins</b> dropdown menu in RStudio. Scroll down a bit, and you'll see an <b>Esquisse</b> section: <img class="size-full wp-image-20456" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01acd10698cdbd6bd4287_Image-1-R-Esquisse-install-addon-in-RStudio-IDE.webp" alt="R Esquisse install addon in RStudio IDE" width="856" height="263" /> Image 1 - R Esquisse addin in RStudio Clicking on the first item in the section will launch the Esquisse GUI. Alternatively, you can the <code>esquisse:esquisser()</code> command from the R console. Whatever the approach you choose, this is the window you'll see: <img class="size-full wp-image-20458" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01acd569a8a6eb8919999_Image-2-R-Esquisse-welcome-window-import-data.webp" alt="R Esquisse welcome window import data" width="1398" height="1003" /> Image 2 - R Esquisse welcome window You're ready to go! In the next section, you'll learn how to import your data in CSV format to Esquisse. <h2 id="data-import">How to Import Data to R Esquisse</h2> There are multiple ways to import data to R Esquisse. As you've seen from the previous image, you can load a <code>data.frame</code> straight from your R environment. For this example, we'll use an '<b>External file'</b>. You can also copy/paste your data or import it from a Google sheet. For simplicity's sake, we'll use the <a href="https://gist.githubusercontent.com/netj/8836201/raw/6f9306ad21398ea43cba4f7d537619d0e07d5ae3/iris.csv" target="_blank" rel="noopener">Iris dataset</a> for this guide. Download it to your machine, click on the <i>Externa file</i> section, and search for the file: <img class="size-full wp-image-20460" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ace55ffbe81ba2828b8_Image-3-Importing-a-CSV-file-with-R-Esquisse.webp" alt="Importing a CSV file with R Esquisse" width="1395" height="1004" /> Image 3 - Importing a CSV file with Esquisse Esquisse will instantly upload your dataset and display the initial rows. If you're content with the display, you'll have the option to either view the complete file or make updates to specific rows or columns by clicking on the<b> Import data</b> button. This will bring you to a blank Esquisse canvas, just like the one you can see below: <img class="size-full wp-image-20462" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01acf87923e0adc156057_Image-4-Blank-R-Esquisse-canvas.webp" alt="Blank R Esquisse canvas" width="1401" height="1004" /> Image 4 - Blank Esquisse canvas You can see the features from the Iris dataset in the <b>Variables</b> container, which means the data is ready to be visualized. That's exactly what we'll do in the following section. <h2 id="data-visualization">How to Visualize Data in R Esquisse - Generate ggplot2 Charts</h2> This section will show you how to make one and two-variable data visualizations, how to tweak title and axis labels, and also how to tweak the general appearance of your charts with only a couple of mouse clicks. You'll also see how to export the R code needed to generate the chart. <h3>Visualize One Variable with Esquisse</h3> One-variable charts are primarily used to show the variable distribution through a histogram, density plot, box plot, or violin plot. These are four different chart types that essentially show the same thing. Start by <b>dragging the <code>sepal.length</code> variable to the X container</b>. You'll immediately see a histogram in your canvas: <img class="size-full wp-image-20464" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ad094ab187560d76f1f_Image-5-Sepal-length-histogram-in-R-Esquisse.webp" alt="Sepal length histogram in R Esquisse" width="1400" height="1005" /> Image 5 - Sepal length histogram If you want to show a density plot instead, <b>click on the Histogram button</b>. This will open a selection tool in which you can change the chart type. The types you can't currently use are grayed out, which makes sense. You can't make a bar chart with a single variable: <img class="size-full wp-image-20466" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ad2a90ae0367bec0f83_Image-6-Possible-chart-types-for-one-variable-data-visualizations-from-R-Esquisse.webp" alt="Possible chart types for one variable data visualizations from R Esquisse" width="1398" height="1007" /> Image 6 - Possible chart types for one variable data visualizations Click on <i>Density</i>, and your chart type on canvas will immediately change: <img class="size-full wp-image-20468" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ad431cb3f392102ff12_Image-7-Sepal-length-density-plot-visualization-in-R-Esquisse.webp" alt="Sepal length density plot visualization in R Esquisse" width="1398" height="1008" /> Image 7 - Sepal length density plot And that's univariate charts in a nutshell. You can tweak them, of course, but that's something we'll explore later with multivariate charts. <blockquote>Looking to dive deeper into Histograms with ggplot2? <a href="https://appsilon.com/ggplot2-histograms/" target="_blank" rel="noopener">Our detailed guide to stunning histograms has you covered</a>.</blockquote> <h3>Visualize Multiple Variables with Esquisse</h3> Multi-variable charts display a relationship between the variables, e.g., sepal length vs. petal length. You can also add color and size properties to these charts to further clarify the distinction. In this section, we'll visualize the sepal length and petal length relationship through a scatter chart. To follow along, <b>drag <code>petal.length</code> variable to the Y container, <code>variety</code> to the Color container, and <code>sepal.length</code> to the Size container</b>. These last two are optional but will make the chart more informative and interesting to look at. Here's what you should see: <img class="size-full wp-image-20470" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ad5bd9dcac7c5751053_Image-8-Scatter-plot-of-sepal-length-and-petal-length-data-visualization-in-R-Esquisse.webp" alt="Scatter plot of sepal length and petal length data visualization in R Esquisse" width="1400" height="1003" /> Image 8 - Scatter plot of sepal length and petal length And that's how you can make multi-variable charts with R Esquisse. The chart is a bit plain currently and has no title or proper axis labels. That's what we'll tweak next. <h3>Configure Title and Axis Labels</h3> The <i>Labels & Title</i> section allows you to tweak everything there is about chart titles, subtitles, captions, axis labels, and even legend titles. <b>Click on the Labels & Title section to expand it, and then specify your values</b>: <img class="size-full wp-image-20472" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ad75fce298147e03f79_Image-9-Title-and-label-tweaking-with-R-Esquisse.webp" alt="Title and label tweaking with R Esquisse" width="1400" height="1003" /> Image 9 - Title and label tweaking Here's what our chart looks like after configuring titles and axis labels: <img class="size-full wp-image-20474" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ad8700c6e7f89a8a6d2_Image-10-Updated-charts-with-title-and-axis-label-changes.webp" alt="Updated charts with title and axis label changes" width="1400" height="1003" /> Image 10 - Updated charts with title and axis labels On the risk of sounding like a salesman, allow us to say one thing - wait, there's more. You can click on the plus button on the right of each property in the <i>Labels & Title</i> section to further tweak the visuals. For example, you can change the font face, font size, and element alignment: <img class="size-full wp-image-20476" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01adaa862659a10c18000_Image-11-Styling-the-title-and-subtitle-text-in-R-Esquisse.webp" alt="Styling the title and subtitle text in R Esquisse" width="1400" height="1003" /> Image 11 - Styling the title and subtitle Here's what the updated chart looks like: <img class="size-full wp-image-20478" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01adb81e2982979dfd1de_Image-12-Updated-chart-text.webp" alt="Updated chart text" width="1400" height="1003" /> Image 12 - Updated chart Long story short, Esquisse allows you to change these things quickly without referencing the <code>ggplot2</code> documentation every time. Let's be honest, you probably can't remember the right function name from the top of your head. And that's fine. <blockquote>Scatter plots can be confusing for beginners - <a href="https://appsilon.com/ggplot-scatter-plots/" target="_blank" rel="noopener">Our detailed article on ggplot2 will teach you everything you need to know</a>.</blockquote> We now have a rich set of titles and axis labels on our chart, but the visualization still looks a bit dull. Let's address the visuals next. <h3>Tweak the Visualization Appearance</h3> The <i>Appearance</i> section in R Esquisse does just what the name suggests - it allows you to tweak the visuals of your chart. You can change the color scheme, marker symbol, theme, and legend position - at least for scatter plots. Other chart types will come with their specific set of tweaking options. For now, <b>click on the Appearance section to see what your options are</b>: <img class="size-full wp-image-20480" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01addfdb8ad62e9cacec8_Image-13-Data-visualization-appearance-tweaking-with-R-Esquisse.webp" alt="Data visualization appearance tweaking with R Esquisse" width="1400" height="1003" /> Image 13 - Appearance tweaking We'll change the color palette and theme to get a more minimalistic chart. We'll also change the position of <strong>Legend</strong> to the top to give more space to the chart. It's strange to say this since the previous theme was named <code>minimal</code>, but we find this one to be more <em>minimal-</em>istic: <img class="size-full wp-image-20482" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01addafc0ff7c6576e636_Image-14-Changing-color-palette-and-theme-of-charts.webp" alt="Changing color palette and theme of ggplot2 charts with R Esquisse" width="1400" height="1003" /> Image 14 - Changing color palette and theme Here's what the updated chart looks like: <img class="size-full wp-image-20484" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ade7e3c4983da403868_Image-15-Updated-R-Esquisse-chart.webp" alt="Updated ggplot2 R Esquisse chart" width="1400" height="1003" /> Image 15 - Updated chart If you don't like the built-in color palettes, you can always bring your own. Esquisse will provide you with as many options are there are distinct categories in the variable selected in the Color container. Our chart is pretty much done, so next, let's see how to get the R code needed to create it. <h3>Export the ggplot2 Visualization Code</h3> The code export tool in R Esquisse is likely the most useful feature of the entire package, since it allows people with no experience in R or <code>ggplot2</code> to create stunning visuals with just drag-and-drop and learn both technologies at the same time. To get started, <b>click on the Code section to get the R code for creating your chart</b>: <img class="size-full wp-image-20486" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01adf2700d7cf10b25fc9_Image-16-ggplot2-code-for-the-chart-example.webp" alt="ggplot2 code for the chart example" width="1400" height="1003" /> Image 16 - ggplot2 code for the chart It won't quite get you there, since it doesn't seem to import the required R packages, and it also doesn't provide a mechanism for loading your data. The Iris dataset is in CSV file format, so you'll have to use the <code>read.csv()</code> function to import it. Here's the entire snippet - modified and fully working: <pre><code class="language-r">library(ggplot2) <br>ggplot(read.csv("/Users/dradecic/Desktop/iris.csv")) + aes( x = sepal.length, y = petal.length, colour = variety, size = sepal.length ) + geom_point(shape = "circle") + scale_color_brewer(palette = "Purples", direction = 1) + labs( x = "Sepal Length", y = "Sepak Width", title = "Sepal Length vs. Sepal Width", subtitle = "A comparison through flower species", caption = "Iris Dataset", color = "Flower class", size = "Sepal Length" ) + theme_classic() + theme( legend.position = "top", plot.title = element_text( size = 17L, face = "bold" ), plot.subtitle = element_text(face = "bold"), plot.caption = element_text(face = "italic") )</code></pre> You'll see a familiar-looking chart if you run the code: <img class="size-full wp-image-20488" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ae18382f4137a9dd1c0_Image-17-Rendered-chart-in-R-Esquisse.webp" alt="Rendered ggplot2 chart in R Esquisse" width="1357" height="996" /> Image 17 - Rendered chart Just remember to import <code>ggplot2</code> and load the data properly - R Esquisse will do the rest. Up next, let's go over some additional features this package provides. <h2 id="additional-features">Additional Features - Multi-Language Support and In-Browser Application</h2> This section will walk you through two additional features present in R Esquisse. <h3>Esquisse Browser Viewer</h3> Maybe you don't like that Esquisse launches in a separate window, and you'd prefer to start it in your favorite browser instead. The developers behind this package have thought of that use case, and have provided you with an additional parameter you need to specify when starting it. Simply add <code>viewer = "browser"</code> and Esquisse will launch in your default web browser: <pre><code class="language-r">library(esquisse) esquisser(viewer = "browser")</code></pre> Here's what it looks like on our end: <img class="size-full wp-image-20490" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ae1832c47d6730f64ac_Image-18-Running-R-Esquisse-in-the-browser.webp" alt="Running R Esquisse in the browser" width="1919" height="1869" /> Image 18 - Esquisse in browser There's one other neat functionality you must know about. <h3>Internationalization with i18n</h3> If you work in a global setting, chances are you might need to add multiple languages. Or maybe you'd prefer to learn <code>ggplot2</code> in your native language. Well, if you live in France (<code>fr</code>), Macedonia (<code>mk</code>), or Albania (<code>sq</code>), you're in luck. It's a short list of languages, but it might just be enough for you. <blockquote>Looking to add internationalization to your Shiny app? <a href="https://appsilon.github.io/shiny.i18n/" target="_blank" rel="noopener">shiny.i18n makes it easier than ever</a>.</blockquote> Use the <code>set_i18n("language_code")</code> function to translate Esquisse. Here's an example of how to translate it into Macedonian: <pre><code class="language-r">library(esquisse) set_i18n("mk") esquisser(viewer = "browser")</code></pre> The translation takes place even on the start screen: <img class="size-full wp-image-20492" src="https://webflow-prod-assets.s3.amazonaws.com/6525256482c9e9a06c7a9d3c%2F65b01ae2c39a0a5ff7ba68b7_Image-19-R-Esquisse-in-Macedonian-internationalization.webp" alt="R Esquisse in Macedonian internationalization" width="1914" height="940" /> Image 19 - Internationalization in Esquisse, Macedonian example And that's the basics of Esquisse. <i>What are the next steps?</i> Read the summary section to find out. <hr /> <h2 id="summary">Get Started with R Esquisse</h2> In today's article, we covered the basics of R Esquisse, including how to install the package, how to import data, and how to create visualizations using the drag-and-drop interface. We also discussed some of the advanced features of the package, such as multi-language support and in-browser application. It's enough to get you started, to say at least. The next step in R Esquisse is to learn how to use it in <b>R Shiny</b>, a web application framework for building interactive web apps with R. In our upcoming article, we will cover how to integrate R Esquisse into an R Shiny app to create a user-friendly interface for exploring and visualizing data. Stay tuned to the blog for that article. <i>What are your thoughts on Esquisse? Does it deliver a Tableau-like user interface? Does your team need more solutions like this?</i> Let us know in the comment section below, or reach out on Twitter - <a href="https://twitter.com/appsilon?lang=en" target="_blank" rel="noopener">@appsilon</a>- We'd love to hear from you. <blockquote>Looking for a more serious Business Intelligence (BI) tool? <a href="https://appsilon.com/top-3-bi-tools/" target="_blank" rel="noopener">Read our comparison between Tableau, PowerBI, and Sisense</a>.</blockquote>