Articles by cornelius

Plotting texts as graphs with R and igraph

August 4, 2010 | cornelius

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...]

Code and brief instruction for graphing Twitter with R

May 23, 2010 | cornelius

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 ... [Read more...]

Corpus Linguistics with R, Day 2

July 28, 2009 | cornelius

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

Corpus Linguistics with R, Day 1

July 28, 2009 | cornelius

(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 [1] 5 [1] 0.6666667 [1] 8 --- Fundamentals - Functions __ log(x=1000, base=10) [1] 3 --- (Formals describes the syntax of other [...] [Read more...]

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)