Skip to content

Instantly share code, notes, and snippets.

@ngsankha
Last active December 11, 2015 01:18
Show Gist options
  • Save ngsankha/4522132 to your computer and use it in GitHub Desktop.
Save ngsankha/4522132 to your computer and use it in GitHub Desktop.
Computing trends in programming languages
# Read all the collected data
java = read.csv(file = "java.csv", header = F, sep = ",")
javascript = read.csv(file = "javascript.csv", header = F, sep = ",")
python = read.csv(file = "python.csv", header = F, sep = ",")
ruby = read.csv(file = "ruby.csv", header = F, sep = ",")
# Sort the data by watchers/forks to format them
java_sorted = java[order(java$V4),]
javascript_sorted = javascript[order(javascript$V4),]
python_sorted = python[order(python$V4),]
ruby_sorted = ruby[order(ruby$V4),]
# Process it against any two programming languages
plotdata = data.frame(java = java_sorted$V4, javascript = javascript_sorted$V4)
f = javascript ~ java + 0
lmfit = lm(f, plotdata)
plot(plotdata)
abline(lmfit)
lmfit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment