Programmatically extract TIOBE Index Ratings

[This article was first published on r-bloggers on Programming with R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

TIOBE Index is an index (ranking) that claims to represent the popularity of programming languages. Yihui (The creator of blogdown package), recently wrote a blogpost titled “On TIOBE Index and the era of decision fatigue” and I strongly recommend you to go through that before continuing with this post.

So the Disclaimer goes like this: This post/author doesn’t believe that TIOBE Index is a fair way to measure/present popularity of programming languages and this is writtet just to teach you how to extract/get TIOBE Index programmatically using the R package tiobeindexr

tiobeindexr – Intro, Installation & Loading

tiobeindexr is an R package to extract TIOBE Index of the given month.

tiobeindexr is available on CRAN so you can install like below:

install.packages("tiobeindexr")

Once installed, it can be loaded like any other R package:

library(tiobeindexr)
## Downloading TIOBE Index Data using your Internet...

When tiobeindexr is loaded for the first time in the given session, it downloads the required data from the internet.

Extract top 20 programming languages of the month

TIOBE Index publishes the rank of programming languages every month (monthly-refresh). We can use the function top_20() to extract the top 20 programming languages of the month (that TIOBE has published)

top_20()
##    Jul 2019 Jul 2018 Programming Language Ratings Change
## 1         1        1                 Java 15.058% -1.08%
## 2         2        2                    C 14.211% -0.45%
## 3         3        4               Python  9.260% +2.90%
## 4         4        3                  C++  6.705% -0.91%
## 5         5        6                   C#  4.365% +0.57%
## 6         6        5    Visual Basic .NET  4.208% -0.04%
## 7         7        8           JavaScript  2.304% -0.53%
## 8         8        7                  PHP  2.167% -0.67%
## 9         9        9                  SQL  1.977% -0.36%
## 10       10       10          Objective-C  1.686% +0.23%
## 11       11       12                 Ruby  1.636% +0.43%
## 12       12       13    Assembly language  1.390% +0.24%
## 13       13       11                Swift  1.121% -0.29%
## 14       14       15               MATLAB  1.078% -0.05%
## 15       15       81               Groovy  1.070% +0.96%
## 16       16       18                   Go  1.016% +0.05%
## 17       17       19         Visual Basic  1.009% +0.12%
## 18       18       16 Delphi/Object Pascal  0.950% -0.16%
## 19       19       17                 Perl  0.918% -0.18%
## 20       20       14                    R  0.837% -0.31%

Visualising Top Changes of TIOBE Index This Month vs Previous Month

As you can see in the output of the previous section, top_20() also gives us the % change MoM (Month-over-Month) which we can use to see the top changes.

For simplicity, We’ll load the entire tidyverse package and use ggplot2’s bar-plot to visualize the changes.

library(tidyverse)

top_20() %>% 
  mutate(Change = as.numeric(gsub('%','',Change))) %>% 
  ggplot(aes(x = reorder(`Programming Language`,Change), y = Change, 
             fill = `Programming Language`,
             label = paste0(Change, "%"))) +
  geom_col(show.legend = FALSE) +
  coord_flip() +
  geom_text(nudge_x = 0.1) +
  xlab('Programming Language') +
  ggtitle('Programming Languages Change this Month') 

Summary

Hence, we learnt how to use tiobeindexr to programmatically download TIOBE Index and visualize insights from it. And, alongisde we also learnt that TIOBE Index in fact isn’t a fair represenation of the popularity of programming languages

To leave a comment for the author, please follow the link and comment on their blog: r-bloggers on Programming with R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)