Blog Archives

Graphing Twitter friends/followers with R (updated yet again)

December 22, 2011
By

Those of you following my occasional updates here know that I have previously posted code for graphing Twitter friend/follower networks using R (post #1. post #2). Kai Heinrich was kind enough to send me some updated code for doing so using a newer version of the extremely useful twitteR package. His very crisp, yet thoroughly

Read more »

Generating graphs of retweets and @-messages on Twitter using R and Gephi

October 17, 2010
By
Generating graphs of retweets and @-messages on Twitter using R and Gephi

After recently discovering the excellent methods section on mappingonlinepublics.net, I decided it was time to document my own approach to Twitter data. I’ve been messing around with R and igraph for a while, but it wasn’t until I discovered Gephi that things really moved forward. R/igraph are great for preprocessing the data (not sure how

Read more »

Plotting texts as graphs with R and igraph

August 4, 2010
By
Plotting texts as graphs with R and igraph

I’ve plotted several word association graphs for this New York Times article (1st paragraph) using R and the igraph library. #1, random method #2, circle method #3, sphere method #4, spring method #5, fruchterman-reingold method # 6, kamada-kawai method #7, graphopt method The red vertices mark cliques. Here’s the (rough) R code for plotting such

Read more »

Graphing Twitter friends/followers with R (updated)

June 24, 2010
By

Edit: And here is an update of the update, this one contributed by Kai Heinrich. Here’s an updated version of my script from last month, something I’ve been meaning to do for a while. I thank Anatol Stefanowitsch and Gábor Csárdi for improving my quite sloppy code. # Load twitteR and igraph packages. library(twitteR) library(igraph)

Read more »

Code and brief instruction for graphing Twitter with R

May 23, 2010
By
Code and brief instruction for graphing Twitter with R

Edit: I’ve posted an updated version of the script here. It is not quite as compressed as Anatol’s version, but I think it’s a decent compromise between readability and efficiency. Edit #2 And yet another update, this one contributed by Kai Heinrich. I hacked together some code for R last night to visualize a Twitter

Read more »

Corpus Linguistics with R, Day 2

July 28, 2009
By

R Lesson 2 text gsub ("second", "third", text) SEARCH-REPLACE-SUBJECT "This is a first example sentence." "And this is a third example sentence." > gsub ("n", "X", text) "This is a first example seXteXce." "AXd this is a secoXd example seXteXce." > gsub ("is", "was", text) "Thwas was a first example

Read more »

Corpus Linguistics with R, Day 1

July 28, 2009
By

(This post documents the first day of a class on R that I took at ESU C&T. I is posted here purely for my own use.) R Lesson 1 > 2+3; 2/3; 2^3 5 0.6666667 8 --- Fundamentals - Functions > log(x=1000, base=10) 3 --- (Formals describes the syntax of other

Read more »