Git Product home page Git Product logo

cancellation-curve-visualizer's Introduction

Cancellation Curve Visualizer

This R script helps you visualize when users cancel their plans for a SaaS product.

For example, here are the cancellation curves for an example SaaS product with three plans, Gold, Silver, and Bronze:

Cancellation Curve Example

This shows is that most users who cancel do so pretty quickly and that long term about 30% of Gold plans, 20% of Silver plans, and 10% of Bronze plans cancel their subscription.

Installing R

If you've never used R before, you'll need to install R and optionally download a tool like RStudio to run this script. You'll also need to install the ggplot2 package with install.packages("ggplot2") and use setwd() to change the working directory to match the location of this script.

How it works

In order for it to work, all you need to do is to generate a CSV file containing three columns:

  1. The unix timestamp when people purchased a plan
  2. The unix timestamp when people cancelled the plan (or blank if it hasn't been cancelled)
  3. The name of the plan

You should not include column headers.

Here's an example:

1451606400,1453359994,gold
1451606400,,gold
1451606400,,gold
1451606400,,silver
1451606400,,silver
1451606400,1455394199,silver

The provided data/example.csv contains a test dataset that you can use to test the script.

You'll need to edit the file variable at the top of cancellation-curve.r based on the name and location of your actual data file.

Testing the script

Within RStudio, simply load the script using source("cancellation-curve.r").

If all went well, it should generate the chart above.

Contact

If you have any suggestions, find a bug, or just want to say hey drop me a note at @mhmazur on Twitter or by email at [email protected].

License

MIT © Automattic

cancellation-curve-visualizer's People

Contributors

mattm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.