Tokyo.R #82

Ryo Nakagawara
October 26th, 2019

About Me

Ryo Nakagawara

  • 学歴:
    • 学士: Chapman University
    • 修士: University College London
  • 専攻:心理学と経済学
  • 仕事: Jr. Data Scientist @ ACDI/VOCA
  • Also: Editor for R Weekly

趣味: サッカー/Football & {ggplot2}

{bulletchartr} package


What IS a bullet chart?

  • 作:Stephen Few
  • Measure KPI vs. target and/or qualitative measures of performance
    • Low-Medium-High, Poor-Satisfactory-Good, etc.
  • Design spec

Example with {bulletchartr}!

  • bulletchartr::bullet_chart(dataframe = data, ...)
  • “Current” value in black
  • Target: red symbol
  • Legend for qualitative labels:
    • “Low”, “Medium”, “High”


  • ACDI/VOCA website
  • Implement economic development projects around the world!
  • 国際開発・農業開発・農村開発援助のNGO
  • To ensure we implement them correctly and make an impact, we create indicators (KPIs) that have yearly targets
  • Monitor progress of projects by tracking these indicators over time.

Collecting data during a project

  • Normally, gather data in a linear way throughout the course of the project (orange line)
  • BUT some project activities are NOT linear
  • Data accumulates in a non-linear way! (purple and green lines)

Example 1:

  • Based on output from harvest (purple line)
    • A lot of data gathered only later in the year
    • 収穫が10月=その時にやっとデータを収集できる

Example 2:

  • Based on distribution of funds, supplies, loans (green line)
    • A lot of data gathered early in the year
    • 機械・設備投資のプロジェクト=年明けに融資する

Time-comparison bullet chart

  • X-Axis scale:
    • Percent of Target
    • Percent of Year

Time-comparison bullet chart (cont.)

  • If “TODAY” = September, then at 75% of the year: 9/12 months
  • “Ind. 04” is at 25% because CURRENT VALUE is 6 and TARGET is 24: 6/24 units
  • At “TODAY” “Ind. 04” should be at 18 or 75% of target: 18/24 units

bullet_chart_*() variants!


bullet_chart_*() variants! (cont.)


{bulletchartr} features: Static vs. Interactive

  • “Static”: Default, normal ggplot2
  • “Interactive”: Powered by ggiraph
bullet_chart_wide(chart_type = "interactive")

{bulletchartr} features: Arguments

  • Legend: TRUE/FALSE
  • Calendar type: Fiscal Year, Regular (start on January 1st), Custom
  • Show text labels: TRUE/FALSE
    • Ind 38: “+4 from Last Week”, “-16 from Last Year”, etc.

Further improvements and CRAN (?)

life cycle: experimental

  • Originally ONLY for company usage, difficulty generalizing package for the public
  • Lots of function arguments, easy defaults necessary for usability (work-in-progress, see package vignettes!)
  • Allow for different qualitative labels (not just “Low”-“Medium”-“High” or “Last Week”, “Last Year”)
    • “Bad”-“Okay”-“Good”, “Unsatisfactory”-“Satisfactory”-“Excellent”, etc.
  • 年末までにCRANリリースを目指します!

Thank you!