Funnel Chart in R-Interactive Funnel Plot

Funnel Chart in R, A funnel chart is mainly used for demonstrates the flow of users through a business or sales process. This chart takes its name from its shape, which starts from a broad head and ends in a small neck.

The number of users at each stage of the process is represented from the funnel’s width as it narrows.

Based on the funnel chart can understand easily there are any significant drop-offs and can make decisions accordingly. Note the drop reasons we need to analyze it separately to get the clarity.

So basically funnel charts are high-level visualization before going to deeper and deeper investigations.

QQ-plots in R: Quantile-Quantile Plots-Quick Start Guide »

In this article we are going to describe how to create a funnel chart in R, that is interactive.

If you are not installed high charter package installs the same based on the below command.

Funnel Chart in R

install.packages(“highcharter”)

 Load required R packages, here we are using dplyr and highcharter.

Error Bar Plot in R-Adding Error Bars-Quick Guide »

library(dplyr)
library(highcharter)

Once you loaded the package then need to set the high charter options.

options(highcharter.theme = hc_theme_smpl(tooltip = list(valueDecimals = 2)))

Let’s create a data frame for plotting

df <- data.frame(
  x = c(0, 1, 2, 3, 4),
  y = c(975, 779, 584, 390, 200),
  name = as.factor(c("Leads", "Sales Call", "Follow Up", "Conversion", "Sale"))
) %>%
  arrange(-y)

Here we are talking about the sales process in different stages like leads, sales call, follow-up, conversion, and sales.

df
  x   y       name
1 0 975      Leads
2 1 779 Sales Call
3 2 584  Follow Up
4 3 390 Conversion
5 4 200       Sale

Let’s create an interactive funnel chart in R

hc <- df %>%
  hchart(
    "funnel", hcaes(x = name, y = y),
    name = "Sales Conversions"
  )
hc

Note displayed normal png image, If you want to see the magic interactive let’s plot it.

Animated Graph GIF with gganimate & ggplot »

Don’t forget to show your love, Subscribe the Newsletter and COMMENT below!
[newsletter_form type="minimal"]

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

2 × 3 =