Skip to content

How can you determine which programming languages and technologies are most widely used? Which languages are gaining or losing popularity, helping you decide where to focus your efforts?

One excellent data source is Stack Overflow, a programming question-and-answer site with more than 16 million questions on programming topics. Each Stack Overflow question is tagged with a label identifying its topic or technology. By counting the number of questions related to each technology, you can estimate the popularity of different programming languages.

In this project, you will use data from the Stack Exchange Data Explorer to examine how the relative popularity of R, Python, Java, and JavaScript has changed over time.

You'll work with a dataset containing one observation per tag per year, including the number of questions for that tag and the total number of questions that year.

stack_overflow_data.csv

ColumnDescription
yearThe year the question was asked (2008-2020)
tagA word or phrase that describes the topic of the question
num_questionsThe number of questions with a certain tag in that year
year_totalThe total number of questions asked in that year
# Load necessary packages
library(readr)
library(dplyr)
library(ggplot2)
Hidden output
# Load the dataset
data <- read_csv("stack_overflow_data.csv")
Hidden output
# Start coding here
r_over_time <- data %>% 
  filter(tag == 'r') %>% 
  mutate(fraction = num_questions / year_total * 100)
r_over_time
ggplot(r_over_time,aes(x=year,y=fraction,color=year)) + geom_line()
r_percentage <- r_over_time %>% filter(year == 2020) %>% select(fraction)
r_percentage <- round(r_percentage$fraction,2)
r_percentage
highest_tags <- data %>% filter(year >= 2015) %>% group_by(tag) %>% summarise(Total_question = sum(num_questions)) %>% arrange(desc(Total_question)) %>% select(tag) %>% head(5)
highest_tags <- highest_tags$tag
highest_tags
highest_ratio_tag <- data %>% group_by(tag) %>% arrange(tag) %>% mutate(fraction=num_questions/year_total) %>% mutate(Increase = fraction / lag(fraction)) %>% slice_max(Increase) %>% arrange(desc(Increase)) %>% head(1) %>% select(tag)
highest_ratio_tag <- highest_ratio_tag$tag