Skip to content

Instantly share code, notes, and snippets.

@geoffjentry
Created January 2, 2014 20:46
Show Gist options
  • Save geoffjentry/8226512 to your computer and use it in GitHub Desktop.
Save geoffjentry/8226512 to your computer and use it in GitHub Desktop.
create data.frame
# tokenize each status. split on comma period or whitespace
status_tokens = strsplit(statuses, ",|\\.|\\s+")
matching_tokens = sapply(status_tokens, function(x) {
x[which(x %in% tiobe_langs)]
})
# Now have the languages mentioned in #code2013 which are in TIOBE
code2013_langs = unlist(matching_tokens)
code2013_lang_table = as.data.frame(sort(table(code2013_langs), decreasing=TRUE))
colnames(code2013_lang_table) = "Count"
# Create a column describing the rough place of the code2013 langs
code2013_lang_table$code2013_tier = ordered(c(rep("1-5", 5), rep("6-10", 5), rep("11-15", 5),
rep("16-25", 10), rep("26-39", 14)), levels=c("1-5", "6-10", "11-15", "16-25", "26-39"))
# Order by the TIOBE rankings
code2013_lang_table$code2013_langs = ordered(rownames(code2013_lang_table),
levels=rev(tiobe[, "lang"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment