Reshaping data to wide format with tidyr

The following makes use of the packages tidyr and readr. You may need to install them from CRAN using the code install.packages(c("tidyr","readr")) if you want to run this on your computer. (The packages are already installed on the notebook container, however.)


substr(readLines("inequality-oecd-downloaded.csv",n=5),
       start=1,stop=40)
[1] "\"LOCATION\",\"INDICATOR\",\"SUBJECT\",\"MEASUR"
[2] "\"AUS\",\"INCOMEINEQ\",\"P50P10\",\"RT\",\"A\",\"20"
[3] "\"AUS\",\"INCOMEINEQ\",\"P50P10\",\"RT\",\"A\",\"20"
[4] "\"AUS\",\"INCOMEINEQ\",\"P50P10\",\"RT\",\"A\",\"20"
[5] "\"AUS\",\"INCOMEINEQ\",\"P90P10\",\"RT\",\"A\",\"20"

library(readr)

inequality.oecd.dld <- read_csv("inequality-oecd-downloaded.csv")
Parsed with column specification:
cols(
  LOCATION = col_character(),
  INDICATOR = col_character(),
  SUBJECT = col_character(),
  MEASURE = col_character(),
  FREQUENCY = col_character(),
  TIME = col_double(),
  Value = col_double(),
  `Flag Codes` = col_character()
)


inequality.oecd.dld
     LOCATION INDICATOR  SUBJECT MEASURE FREQUENCY TIME Value Flag Codes
1    AUS      INCOMEINEQ P50P10  RT      A         2012 2.200 NA
2    AUS      INCOMEINEQ P50P10  RT      A         2014 2.200 NA
3    AUS      INCOMEINEQ P50P10  RT      A         2016 2.100 NA
4    AUS      INCOMEINEQ P90P10  RT      A         2012 4.400 NA
5    AUS      INCOMEINEQ P90P10  RT      A         2014 4.300 NA
6    AUS      INCOMEINEQ P90P10  RT      A         2016 4.300 NA
7    AUS      INCOMEINEQ P90P50  RT      A         2012 2.000 NA
8    AUS      INCOMEINEQ P90P50  RT      A         2014 2.000 NA
9    AUS      INCOMEINEQ P90P50  RT      A         2016 2.100 NA
10   AUS      INCOMEINEQ GINI    INEQ    A         2012 0.326 NA
11   AUS      INCOMEINEQ GINI    INEQ    A         2014 0.337 NA
12   AUS      INCOMEINEQ GINI    INEQ    A         2016 0.330 NA
13   AUT      INCOMEINEQ P50P10  RT      A         2007 2.000 NA
14   AUT      INCOMEINEQ P50P10  RT      A         2008 1.900 NA
15   AUT      INCOMEINEQ P50P10  RT      A         2009 2.000 NA
16   AUT      INCOMEINEQ P50P10  RT      A         2010 1.900 NA
17   AUT      INCOMEINEQ P50P10  RT      A         2011 1.900 NA
18   AUT      INCOMEINEQ P50P10  RT      A         2012 2.000 NA
19   AUT      INCOMEINEQ P50P10  RT      A         2013 1.900 NA
20   AUT      INCOMEINEQ P50P10  RT      A         2014 1.900 NA
21   AUT      INCOMEINEQ P50P10  RT      A         2015 1.900 NA
22   AUT      INCOMEINEQ P50P10  RT      A         2016 2.000 NA
23   AUT      INCOMEINEQ P90P10  RT      A         2007 3.600 NA
24   AUT      INCOMEINEQ P90P10  RT      A         2008 3.400 NA
25   AUT      INCOMEINEQ P90P10  RT      A         2009 3.600 NA
26   AUT      INCOMEINEQ P90P10  RT      A         2010 3.500 NA
27   AUT      INCOMEINEQ P90P10  RT      A         2011 3.500 NA
28   AUT      INCOMEINEQ P90P10  RT      A         2012 3.500 NA
29   AUT      INCOMEINEQ P90P10  RT      A         2013 3.400 NA
30   AUT      INCOMEINEQ P90P10  RT      A         2014 3.400 NA
⋮    ⋮        ⋮          ⋮       ⋮       ⋮         ⋮    ⋮     ⋮
2286 LTU      INCOMEINEQ PALMA   RT      A         2006 1.26  NA
2287 LTU      INCOMEINEQ PALMA   RT      A         2007 1.33  NA
2288 LTU      INCOMEINEQ PALMA   RT      A         2008 1.48  NA
2289 LTU      INCOMEINEQ PALMA   RT      A         2009 1.53  NA
2290 LTU      INCOMEINEQ PALMA   RT      A         2010 1.24  NA
2291 LTU      INCOMEINEQ PALMA   RT      A         2011 1.20  NA
2292 LTU      INCOMEINEQ PALMA   RT      A         2012 1.42  NA
2293 LTU      INCOMEINEQ PALMA   RT      A         2013 1.42  NA
2294 LTU      INCOMEINEQ PALMA   RT      A         2014 1.67  NA
2295 LTU      INCOMEINEQ PALMA   RT      A         2015 1.59  NA
2296 LTU      INCOMEINEQ PALMA   RT      A         2016 1.65  NA
2297 RUS      INCOMEINEQ PALMA   RT      A         2011 1.59  NA
2298 RUS      INCOMEINEQ PALMA   RT      A         2016 1.28  NA
2299 SVN      INCOMEINEQ PALMA   RT      A         2004 0.80  NA
2300 SVN      INCOMEINEQ PALMA   RT      A         2005 0.80  NA
2301 SVN      INCOMEINEQ PALMA   RT      A         2006 0.79  NA
2302 SVN      INCOMEINEQ PALMA   RT      A         2007 0.79  NA
2303 SVN      INCOMEINEQ PALMA   RT      A         2008 0.77  NA
2304 SVN      INCOMEINEQ PALMA   RT      A         2009 0.82  NA
2305 SVN      INCOMEINEQ PALMA   RT      A         2010 0.81  NA
2306 SVN      INCOMEINEQ PALMA   RT      A         2011 0.81  NA
2307 SVN      INCOMEINEQ PALMA   RT      A         2012 0.83  NA
2308 SVN      INCOMEINEQ PALMA   RT      A         2013 0.86  NA
2309 SVN      INCOMEINEQ PALMA   RT      A         2014 0.85  NA
2310 SVN      INCOMEINEQ PALMA   RT      A         2015 0.84  NA
2311 SVN      INCOMEINEQ PALMA   RT      A         2016 0.81  NA
2312 ZAF      INCOMEINEQ PALMA   RT      A         2015 7.03  P
2313 KOR      INCOMEINEQ PALMA   RT      A         2015 1.42  NA
2314 KOR      INCOMEINEQ PALMA   RT      A         2016 1.45  NA
2315 KOR      INCOMEINEQ PALMA   RT      A         2017 1.44  NA

library(tidyr)

inequality.oecd.dld %>% spread(key="SUBJECT",value="Value") ->
                                               inequality.oecd

inequality.oecd[-c(2,4,6)]
    LOCATION MEASURE TIME GINI  P50P10 P90P10 P90P50 PALMA S80S20
1   AUS      INEQ    2012 0.326  NA     NA     NA      NA   NA
2   AUS      INEQ    2014 0.337  NA     NA     NA      NA   NA
3   AUS      INEQ    2016 0.330  NA     NA     NA      NA   NA
4   AUS      RT      2012    NA 2.2    4.4    2.0    1.24  5.5
5   AUS      RT      2014    NA 2.2    4.3    2.0    1.34  5.7
6   AUS      RT      2016    NA 2.1    4.3    2.1    1.26  5.5
7   AUT      INEQ    2007 0.284  NA     NA     NA      NA   NA
8   AUT      INEQ    2008 0.281  NA     NA     NA      NA   NA
9   AUT      INEQ    2009 0.289  NA     NA     NA      NA   NA
10  AUT      INEQ    2010 0.280  NA     NA     NA      NA   NA
11  AUT      INEQ    2011 0.281  NA     NA     NA      NA   NA
12  AUT      INEQ    2012 0.275  NA     NA     NA      NA   NA
13  AUT      INEQ    2013 0.279  NA     NA     NA      NA   NA
14  AUT      INEQ    2014 0.274  NA     NA     NA      NA   NA
15  AUT      INEQ    2015 0.276  NA     NA     NA      NA   NA
16  AUT      INEQ    2016 0.284  NA     NA     NA      NA   NA
17  AUT      RT      2007    NA 2.0    3.6    1.8    1.00  4.4
18  AUT      RT      2008    NA 1.9    3.4    1.8    1.00  4.3
19  AUT      RT      2009    NA 2.0    3.6    1.8    1.03  4.5
20  AUT      RT      2010    NA 1.9    3.5    1.8    0.98  4.3
21  AUT      RT      2011    NA 1.9    3.5    1.8    0.99  4.4
22  AUT      RT      2012    NA 2.0    3.5    1.8    0.96  4.2
23  AUT      RT      2013    NA 1.9    3.4    1.8    0.99  4.2
24  AUT      RT      2014    NA 1.9    3.4    1.7    0.96  4.1
25  AUT      RT      2015    NA 1.9    3.3    1.7    0.96  4.2
26  AUT      RT      2016    NA 2.0    3.5    1.8    1.00  4.5
27  BEL      INEQ    2004 0.287  NA     NA     NA      NA   NA
28  BEL      INEQ    2005 0.277  NA     NA     NA      NA   NA
29  BEL      INEQ    2006 0.268  NA     NA     NA      NA   NA
30  BEL      INEQ    2007 0.277  NA     NA     NA      NA   NA
⋮   ⋮        ⋮       ⋮    ⋮     ⋮      ⋮      ⋮      ⋮     ⋮
742 SWE      INEQ    2015 0.278  NA      NA    NA      NA    NA
743 SWE      INEQ    2016 0.282  NA      NA    NA      NA    NA
744 SWE      INEQ    2017 0.282  NA      NA    NA      NA    NA
745 SWE      RT      2013    NA 1.9     3.2   1.7    0.94   4.0
746 SWE      RT      2014    NA 1.9     3.3   1.7    0.97   4.1
747 SWE      RT      2015    NA 2.0     3.3   1.7    0.99   4.2
748 SWE      RT      2016    NA 1.9     3.3   1.7    1.02   4.2
749 SWE      RT      2017    NA 2.0     3.3   1.7    1.02   4.2
750 TUR      INEQ    2011 0.403  NA      NA    NA      NA    NA
751 TUR      INEQ    2012 0.399  NA      NA    NA      NA    NA
752 TUR      INEQ    2013 0.390  NA      NA    NA      NA    NA
753 TUR      INEQ    2014 0.398  NA      NA    NA      NA    NA
754 TUR      INEQ    2015 0.404  NA      NA    NA      NA    NA
755 TUR      RT      2011    NA 2.5     6.1   2.5    1.89   8.0
756 TUR      RT      2012    NA 2.4     6.0   2.5    1.86   7.7
757 TUR      RT      2013    NA 2.4     5.9   2.5    1.76   7.5
758 TUR      RT      2014    NA 2.4     5.9   2.5    1.84   7.7
759 TUR      RT      2015    NA 2.3     5.7   2.5    1.91   7.8
760 USA      INEQ    2013 0.396  NA      NA    NA      NA    NA
761 USA      INEQ    2014 0.394  NA      NA    NA      NA    NA
762 USA      INEQ    2015 0.390  NA      NA    NA      NA    NA
763 USA      INEQ    2016 0.391  NA      NA    NA      NA    NA
764 USA      INEQ    2017 0.390  NA      NA    NA      NA    NA
765 USA      RT      2013    NA 2.7     6.4   2.3    1.82   8.6
766 USA      RT      2014    NA 2.7     6.4   2.3    1.79   8.7
767 USA      RT      2015    NA 2.7     6.1   2.3    1.75   8.3
768 USA      RT      2016    NA 2.7     6.3   2.3    1.77   8.5
769 USA      RT      2017    NA 2.7     6.2   2.3    1.76   8.4
770 ZAF      INEQ    2015 0.620  NA      NA    NA      NA    NA
771 ZAF      RT      2015    NA 4.8    25.6   5.3    7.03  37.6

library(dplyr)

Attaching package: ‘dplyr’


The following objects are masked from ‘package:stats’:

    filter, lag


The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union



inequality.oecd.sub <- select(inequality.oecd.dld,
                              LOCATION,SUBJECT,TIME,Value)
inequality.oecd.sub
     LOCATION SUBJECT TIME Value
1    AUS      P50P10  2012 2.200
2    AUS      P50P10  2014 2.200
3    AUS      P50P10  2016 2.100
4    AUS      P90P10  2012 4.400
5    AUS      P90P10  2014 4.300
6    AUS      P90P10  2016 4.300
7    AUS      P90P50  2012 2.000
8    AUS      P90P50  2014 2.000
9    AUS      P90P50  2016 2.100
10   AUS      GINI    2012 0.326
11   AUS      GINI    2014 0.337
12   AUS      GINI    2016 0.330
13   AUT      P50P10  2007 2.000
14   AUT      P50P10  2008 1.900
15   AUT      P50P10  2009 2.000
16   AUT      P50P10  2010 1.900
17   AUT      P50P10  2011 1.900
18   AUT      P50P10  2012 2.000
19   AUT      P50P10  2013 1.900
20   AUT      P50P10  2014 1.900
21   AUT      P50P10  2015 1.900
22   AUT      P50P10  2016 2.000
23   AUT      P90P10  2007 3.600
24   AUT      P90P10  2008 3.400
25   AUT      P90P10  2009 3.600
26   AUT      P90P10  2010 3.500
27   AUT      P90P10  2011 3.500
28   AUT      P90P10  2012 3.500
29   AUT      P90P10  2013 3.400
30   AUT      P90P10  2014 3.400
⋮    ⋮        ⋮       ⋮    ⋮
2286 LTU      PALMA   2006 1.26
2287 LTU      PALMA   2007 1.33
2288 LTU      PALMA   2008 1.48
2289 LTU      PALMA   2009 1.53
2290 LTU      PALMA   2010 1.24
2291 LTU      PALMA   2011 1.20
2292 LTU      PALMA   2012 1.42
2293 LTU      PALMA   2013 1.42
2294 LTU      PALMA   2014 1.67
2295 LTU      PALMA   2015 1.59
2296 LTU      PALMA   2016 1.65
2297 RUS      PALMA   2011 1.59
2298 RUS      PALMA   2016 1.28
2299 SVN      PALMA   2004 0.80
2300 SVN      PALMA   2005 0.80
2301 SVN      PALMA   2006 0.79
2302 SVN      PALMA   2007 0.79
2303 SVN      PALMA   2008 0.77
2304 SVN      PALMA   2009 0.82
2305 SVN      PALMA   2010 0.81
2306 SVN      PALMA   2011 0.81
2307 SVN      PALMA   2012 0.83
2308 SVN      PALMA   2013 0.86
2309 SVN      PALMA   2014 0.85
2310 SVN      PALMA   2015 0.84
2311 SVN      PALMA   2016 0.81
2312 ZAF      PALMA   2015 7.03
2313 KOR      PALMA   2015 1.42
2314 KOR      PALMA   2016 1.45
2315 KOR      PALMA   2017 1.44

inequality.oecd.sub %>% spread(key=SUBJECT,
                               value=Value) -> inequality.oecd

inequality.oecd
    LOCATION TIME GINI  P50P10 P90P10 P90P50 PALMA S80S20
1   AUS      2012 0.326 2.2     4.4   2.0    1.24   5.5
2   AUS      2014 0.337 2.2     4.3   2.0    1.34   5.7
3   AUS      2016 0.330 2.1     4.3   2.1    1.26   5.5
4   AUT      2007 0.284 2.0     3.6   1.8    1.00   4.4
5   AUT      2008 0.281 1.9     3.4   1.8    1.00   4.3
6   AUT      2009 0.289 2.0     3.6   1.8    1.03   4.5
7   AUT      2010 0.280 1.9     3.5   1.8    0.98   4.3
8   AUT      2011 0.281 1.9     3.5   1.8    0.99   4.4
9   AUT      2012 0.275 2.0     3.5   1.8    0.96   4.2
10  AUT      2013 0.279 1.9     3.4   1.8    0.99   4.2
11  AUT      2014 0.274 1.9     3.4   1.7    0.96   4.1
12  AUT      2015 0.276 1.9     3.3   1.7    0.96   4.2
13  AUT      2016 0.284 2.0     3.5   1.8    1.00   4.5
14  BEL      2004 0.287 1.9     3.3   1.7    1.05   4.2
15  BEL      2005 0.277 2.0     3.4   1.7    0.99   4.1
16  BEL      2006 0.268 2.0     3.4   1.7    0.93   4.0
17  BEL      2007 0.277 1.9     3.3   1.7    0.98   4.1
18  BEL      2008 0.266 2.0     3.4   1.7    0.91   3.9
19  BEL      2009 0.272 2.0     3.4   1.7    0.95   4.1
20  BEL      2010 0.267 2.0     3.4   1.7    0.92   4.0
21  BEL      2011 0.270 2.0     3.4   1.7    0.93   4.0
22  BEL      2012 0.265 2.0     3.4   1.7    0.91   3.9
23  BEL      2013 0.265 2.0     3.4   1.7    0.90   3.9
24  BEL      2014 0.266 1.9     3.4   1.7    0.92   3.9
25  BEL      2015 0.268 2.0     3.4   1.7    0.93   4.0
26  BEL      2016 0.266 2.0     3.3   1.7    0.92   3.9
27  BRA      2006 0.510 3.1    10.4   3.4    3.39  15.3
28  BRA      2009 0.485 2.8     8.9   3.1    2.96  13.1
29  BRA      2011 0.483 3.1     9.3   3.0    2.95  13.9
30  BRA      2013 0.470 3.0     8.7   2.9    2.71  12.5
⋮   ⋮        ⋮    ⋮     ⋮      ⋮      ⋮      ⋮     ⋮
357 SVK      2016 0.241 1.9     3.1   1.6    0.79   3.7
358 SVN      2004 0.241 1.8     3.0   1.7    0.80   3.5
359 SVN      2005 0.240 1.8     3.0   1.7    0.80   3.5
360 SVN      2006 0.237 1.8     3.0   1.7    0.79   3.4
361 SVN      2007 0.239 1.8     3.0   1.6    0.79   3.5
362 SVN      2008 0.234 1.8     3.0   1.6    0.77   3.4
363 SVN      2009 0.245 1.9     3.1   1.7    0.82   3.6
364 SVN      2010 0.244 1.9     3.2   1.6    0.81   3.6
365 SVN      2011 0.244 1.9     3.2   1.6    0.81   3.6
366 SVN      2012 0.249 2.0     3.2   1.7    0.83   3.7
367 SVN      2013 0.254 2.0     3.3   1.7    0.86   3.8
368 SVN      2014 0.251 2.0     3.3   1.7    0.85   3.7
369 SVN      2015 0.250 1.9     3.2   1.6    0.84   3.7
370 SVN      2016 0.244 1.9     3.1   1.7    0.81   3.6
371 SWE      2013 0.268 1.9     3.2   1.7    0.94   4.0
372 SWE      2014 0.274 1.9     3.3   1.7    0.97   4.1
373 SWE      2015 0.278 2.0     3.3   1.7    0.99   4.2
374 SWE      2016 0.282 1.9     3.3   1.7    1.02   4.2
375 SWE      2017 0.282 2.0     3.3   1.7    1.02   4.2
376 TUR      2011 0.403 2.5     6.1   2.5    1.89   8.0
377 TUR      2012 0.399 2.4     6.0   2.5    1.86   7.7
378 TUR      2013 0.390 2.4     5.9   2.5    1.76   7.5
379 TUR      2014 0.398 2.4     5.9   2.5    1.84   7.7
380 TUR      2015 0.404 2.3     5.7   2.5    1.91   7.8
381 USA      2013 0.396 2.7     6.4   2.3    1.82   8.6
382 USA      2014 0.394 2.7     6.4   2.3    1.79   8.7
383 USA      2015 0.390 2.7     6.1   2.3    1.75   8.3
384 USA      2016 0.391 2.7     6.3   2.3    1.77   8.5
385 USA      2017 0.390 2.7     6.2   2.3    1.76   8.4
386 ZAF      2015 0.620 4.8    25.6   5.3    7.03  37.6

inequality.oecd.dld %>% pivot_wider(names_from=SUBJECT,
                                    values_from=Value,
                                    id_cols=c(LOCATION,TIME)) ->
                                                inequality.oecd

inequality.oecd
    LOCATION TIME P50P10 P90P10 P90P50 GINI  S80S20 PALMA
1   AUS      2012 2.2    4.4    2.0    0.326 5.5    1.24
2   AUS      2014 2.2    4.3    2.0    0.337 5.7    1.34
3   AUS      2016 2.1    4.3    2.1    0.330 5.5    1.26
4   AUT      2007 2.0    3.6    1.8    0.284 4.4    1.00
5   AUT      2008 1.9    3.4    1.8    0.281 4.3    1.00
6   AUT      2009 2.0    3.6    1.8    0.289 4.5    1.03
7   AUT      2010 1.9    3.5    1.8    0.280 4.3    0.98
8   AUT      2011 1.9    3.5    1.8    0.281 4.4    0.99
9   AUT      2012 2.0    3.5    1.8    0.275 4.2    0.96
10  AUT      2013 1.9    3.4    1.8    0.279 4.2    0.99
11  AUT      2014 1.9    3.4    1.7    0.274 4.1    0.96
12  AUT      2015 1.9    3.3    1.7    0.276 4.2    0.96
13  AUT      2016 2.0    3.5    1.8    0.284 4.5    1.00
14  BEL      2004 1.9    3.3    1.7    0.287 4.2    1.05
15  BEL      2005 2.0    3.4    1.7    0.277 4.1    0.99
16  BEL      2006 2.0    3.4    1.7    0.268 4.0    0.93
17  BEL      2007 1.9    3.3    1.7    0.277 4.1    0.98
18  BEL      2008 2.0    3.4    1.7    0.266 3.9    0.91
19  BEL      2009 2.0    3.4    1.7    0.272 4.1    0.95
20  BEL      2010 2.0    3.4    1.7    0.267 4.0    0.92
21  BEL      2011 2.0    3.4    1.7    0.270 4.0    0.93
22  BEL      2012 2.0    3.4    1.7    0.265 3.9    0.91
23  BEL      2013 2.0    3.4    1.7    0.265 3.9    0.90
24  BEL      2014 1.9    3.4    1.7    0.266 3.9    0.92
25  BEL      2015 2.0    3.4    1.7    0.268 4.0    0.93
26  BEL      2016 2.0    3.3    1.7    0.266 3.9    0.92
27  CAN      1976 2.3    4.2    1.8    0.303 5.1    1.09
28  CAN      1977 2.4    4.3    1.8    0.289 4.9    0.99
29  CAN      1978 2.3    4.2    1.8    0.294 4.9    1.04
30  CAN      1979 2.3    4.1    1.8    0.289 4.8    1.00
⋮   ⋮        ⋮    ⋮      ⋮      ⋮      ⋮     ⋮      ⋮
357 LTU      2004 2.3     5.0   2.2    0.350  6.3   1.41
358 LTU      2005 2.3     5.2   2.2    0.352  6.4   1.43
359 LTU      2006 2.2     4.6   2.1    0.329  5.6   1.26
360 LTU      2007 2.3     4.6   2.0    0.338  5.8   1.33
361 LTU      2008 2.3     4.8   2.1    0.358  6.3   1.48
362 LTU      2009 2.4     5.5   2.3    0.366  7.2   1.53
363 LTU      2010 2.2     4.7   2.1    0.329  5.7   1.24
364 LTU      2011 2.1     4.5   2.1    0.322  5.3   1.20
365 LTU      2012 2.2     4.8   2.1    0.350  6.2   1.42
366 LTU      2013 2.2     4.9   2.3    0.352  6.1   1.42
367 LTU      2014 2.4     5.4   2.2    0.381  7.4   1.67
368 LTU      2015 2.5     5.5   2.3    0.372  7.1   1.59
369 LTU      2016 2.6     5.8   2.2    0.378  7.5   1.65
370 BRA      2006 3.1    10.4   3.4    0.510 15.3   3.39
371 BRA      2009 2.8     8.9   3.1    0.485 13.1   2.96
372 BRA      2011 3.1     9.3   3.0    0.483 13.9   2.95
373 BRA      2013 3.0     8.7   2.9    0.470 12.5   2.71
374 CHN      2011 7.8    23.0   2.9    0.514 28.3   3.86
375 CRI      2010 2.9     9.3   3.2    0.472 12.1   2.73
376 CRI      2011 3.0    10.2   3.4    0.480 13.1   2.87
377 CRI      2012 3.1     9.9   3.2    0.483 13.5   2.93
378 CRI      2013 3.2    10.8   3.4    0.494 14.3   3.09
379 CRI      2014 3.2    10.4   3.3    0.485 13.7   2.98
380 CRI      2015 3.1    10.3   3.3    0.479 13.4   2.85
381 CRI      2016 3.1    10.2   3.3    0.484 13.5   2.94
382 CRI      2017 3.0    10.0   3.4    0.480 13.0   2.88
383 CRI      2018 3.1    10.2   3.3    0.479 13.2   2.85
384 IND      2004 2.9     9.1   3.2    0.482 12.5   2.88
385 IND      2011 2.9     9.4   3.2    0.495 13.4   3.09
386 ZAF      2015 4.8    25.6   5.3    0.620 37.6   7.03

Downloadable R script and interactive version

Explanation

The link with the “jupyterhub” icon directs you to an interactive Jupyter1 notebook, which runs inside a Docker container2. There are two variants of the interative notebook. One shuts down after 60 seconds and does not require a sign it. The other requires sign in using your ORCID3 credentials, yet shuts down only after 24 hours. (There is no guarantee that such a container persists that long, it may be shut down earlier for maintenance purposes.) After shutdown all data within the container will be reset, i.e. all files created by the user will be deleted.4

Above you see a rendered version of the Jupyter notebook.5

1

For more information about Jupyter see http://jupyter.org. The Jupyter notebooks make use of the IRKernel package.

2

For more information about Docker see https://docs.docker.com/. The container images were created with repo2docker, while containers are run with docker spawner.

3

ORCID is a free service for the authentication of researchers. It also allows to showcase publications and contributions to the academic community such as peer review.. See https://info.orcid.org/what-is-orcid/ for more information.

4

The Jupyter notebooks come with NO WARRANTY whatsoever. They are provided for educational and illustrative purposes only. Do not use them for production work.

5

The notebook is rendered with the help of the nbsphinx extension.