<data:blog.pageTitle/>

This Page

has moved to a new address:

http://www.mediaevaluationresearch.com/blog

Sorry for the inconvenienceā€¦

Redirection provided by Blogger to WordPress Migration Service
Evaluating the media: Text analysis using R

PR geekiness - the tools & techniques to gain insights from PR exposure

Friday, October 05, 2012

Text analysis using R


Just a brief post to express my excitement at generating some (meaningful) results using R. While many might see it as early days, this is the first tangible list of incidence of key emotions from a Twitter stream relating to Sony mobiles:

> dataSet <- read.csv("SonyUKMentions.csv")
> em <- classify_emotion(dataSet$Summary, algorithm = "bayes")
> print(xtable(table(em[, "BEST_FIT"]), caption = "Tweet emotion"))
% latex table generated in R 2.15.1 by xtable 1.7-0 package
% Fri Oct 05 16:39:53 2012
\begin{table}[ht]
\begin{center}
\begin{tabular}{rr}
  \hline
 & V1 \\
  \hline
anger &  21 \\
  disgust &   7 \\
  fear &  13 \\
  joy & 275 \\
  sadness &  12 \\
  surprise &  12 \\

All that effort for the last 6 lines! I am going to carry on experimenting with the sentiment package, apply it to other feeds and try some other packages, possibly involving graphs...

 

2 Comments:

Blogger Mat Morrison said...

What packages are you using? And are you normally a LaTex person?

8:17 pm

 
Blogger Michael Blowers said...

Hi Mat, Sorry delay in replying. I was using TwitteR to collect and Sentiment (plus other associated) packages to do the Baysian bit.

5:33 pm

 

Post a Comment

Thank you for your comment.

<< Home