Esquisse tutorial

Introduction

What is Esquisse?

Esquisse package helps to explore and visualize your data interactively. It is a Shiny app. This package allows you to drag and drop the variables from your dataframe and create ggplot charts. Moreover, you can export the code to your environment and further change or add extra annotations. After putting everything together, you can export to ‘PNG’ or ‘ppt’(Power Point).

Installation

First you have to install the package. This can be done by the following command: install.packages(“esquisse”)

After installation it’s time to load the required packages to Esquisse work.

library(esquisse)
library(ggthemes)
library(hrbrthemes)
library(tidyverse)
library(palmerpenguins)

After loading these packages we ready to work with some data. Let’s take for instance the penguins data frame.

# A tibble: 6 × 8
  species island    bill_length_mm bill_depth_mm flipper_l…¹ body_…² sex    year
  <fct>   <fct>              <dbl>         <dbl>       <int>   <int> <fct> <int>
1 Adelie  Torgersen           39.1          18.7         181    3750 male   2007
2 Adelie  Torgersen           39.5          17.4         186    3800 fema…  2007
3 Adelie  Torgersen           40.3          18           195    3250 fema…  2007
4 Adelie  Torgersen           NA            NA            NA      NA <NA>   2007
5 Adelie  Torgersen           36.7          19.3         193    3450 fema…  2007
6 Adelie  Torgersen           39.3          20.6         190    3650 male   2007
# … with abbreviated variable names ¹​flipper_length_mm, ²​body_mass_g

Executing the esquisse

The esquisse function is our next step.

# esquisse::esquisser()

You’ll be directed to a webpage as shown in the figure.

Making your first plot

We can import the data frame from several sources. But since we already our data in the environment we can pick the default option.

Load de data and you a ready to make your own plots just dragging and dropping the variables. I’ll show an example below:

After selecting the variables you want to analyze and plot you can change the labels and titles, plot options, appearance, data (scale) and import the code to your script.

Importing the code

ggplot(data) +
  aes(x = bill_depth_mm, y = bill_length_mm, colour = species) +
  geom_point(shape = "circle", size = 1.5) +
  scale_color_hue(direction = 1) +
  labs(x = "Bill depth (mm)", y = "Bill length (mm)") +
  theme_minimal()

This is a fast tutorial on how to use the esquisse package. This can improve your abilities in data analysis and presenting data.