Global growth: How much slower without China? (rCharts post)

Reading Time:

A simple growth chart coded with rCharts

This interactive chart can be produced with just a few lines of code:

## Download global growth rates
csv  <- url("https://raw.github.com/zilinskyjan/datasets/master/fiscal/fiscal_global.csv")
glob <- read.csv(csv)

## To run the mPlot command, load rCharts
library(rCharts)

## Treat years as characters to avoid display of days
glob$year <- as.character(glob$year)

## Make the chart
m2 <- mPlot(x = "year", y = c("gr_w", "gr_noChina"), type = "Line", data = glob)
m2$set(pointSize = 0, lineWidth = 1)
m2$print("globalGrowth")

When copying the printed code, adjust labels as needed:

"pointSize":              0,
"lineWidth":              1,
"id": "globalGrowth",
"labels": ["Global growht", "Excluding China"] 

Add morris.js and the required dependencies to your html file:

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>

China's Belt and Road Initiative

PIIE BRIEFING 16-2: China's Belt and Road Initiative: Motives, Scope, and Challenges: China's commercial ties with the outside world have long been symbolized by the ancient...

R Shiny app: Line charts for distinct sub-samples

Tutorial: reproducing a fiscal chart A few days ago, I posted a chart that looked like this [static screenshot below] The dataset is posted at: https:...