Brown, Tony Nicholas
2009-Jun-07 18:41 UTC
[R] graphically representing frequency of words in a speech?
Dear all, I recently saw a graph on television that displayed selected words/phrases in a speech scaled in size according to their frequency. So words/phrases that were often used appeared large and words that were rarely used appeared small. The closest thing I can find on the web to approximate what I saw can be found here: http://stateoftheunion.onetwothree.net/ The example at that website is more complicated but captures the general idea. Would someone point me in the right direction in terms of replicating such a graph. Thanks in advance, Tony ------------------------------------------------------------------------ ----------------------------------------------------- Tony N. Brown, Ph.D. Editor-Elect, American Sociological Review Associate Professor of Sociology and Human and Organizational Development (secondary) Program Faculty, Effective Health Communication and African American & Diaspora Studies Faculty Head of Hank Ingram House, The Commons Vanderbilt University (615) 322-7518 (615) 322-7505 fax [[alternative HTML version deleted]]
Marc Schwartz
2009-Jun-07 19:02 UTC
[R] graphically representing frequency of words in a speech?
On Jun 7, 2009, at 1:41 PM, Brown, Tony Nicholas wrote:> Dear all, > > I recently saw a graph on television that displayed selected > words/phrases in a speech scaled in size according to their frequency. > So words/phrases that were often used appeared large and words that > were > rarely used appeared small. The closest thing I can find on the web to > approximate what I saw can be found here: > http://stateoftheunion.onetwothree.net/ The example at that website is > more complicated but captures the general idea. > > Would someone point me in the right direction in terms of replicating > such a graph. > > Thanks in advance, > > TonyTony, What you are referring to is called a 'tag cloud'. See this page: http://en.wikipedia.org/wiki/Tag_cloud They are commonly used on wikis, Twitter and so forth. For example: http://tweetstats.com/trends The only thing that I found for R is by Gregor Gorjanc, but the information seems to be dated: http://www.bfro.uni-lj.si/MR/ggorjan/software/R/index.html#tagCloud I have cc'd him here for any updates. Otherwise, there are some links on the Wikipedia page and some other applications such as Wordle: http://www.wordle.net/ HTH, Marc Schwartz
Yihui Xie
2009-Jun-10 08:15 UTC
[R] graphically representing frequency of words in a speech?
Hi, As Gregor Gorjanc mentioned, it's very inconvenient to let R decide the fontsize and placement of words in a plot. There have already been very mature applications of tag cloud; one of them I'm relatively familiar is the WordPress plugin "wp-cumulus", which makes use of a Flash object to generate tag cloud, and it has fantastic 3D rotation effect of the cloud. I've spent a couple of hours porting it into R; see the source code and effect here: http://yihui.name/en/2009/06/creating-tag-cloud-using-r-and-flash-javascript-swfobject/ HTH. Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Mon, Jun 8, 2009 at 2:41 AM, Brown, Tony Nicholas<tony.n.brown at vanderbilt.edu> wrote:> Dear all, > > > > I recently saw a graph on television that displayed selected > words/phrases in a speech scaled in size according to their frequency. > So words/phrases that were often used appeared large and words that were > rarely used appeared small. The closest thing I can find on the web to > approximate what I saw can be found here: > http://stateoftheunion.onetwothree.net/ The example at that website is > more complicated but captures the general idea. > > > > Would someone point me in the right direction in terms of replicating > such a graph. > > > > Thanks in advance, > > Tony > > > > ------------------------------------------------------------------------ > ----------------------------------------------------- > > Tony N. Brown, Ph.D. > > Editor-Elect, American Sociological Review > > Associate Professor of Sociology and Human and Organizational > Development (secondary) > > Program Faculty, Effective Health Communication and African American & > Diaspora Studies > > Faculty Head of Hank Ingram House, The Commons > > Vanderbilt University > > (615) 322-7518 > > (615) 322-7505 fax > > > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >