About Me

My photo
Just wasting time sharing knowledge about, Big Data and Analytics

May 6, 2013

Monitoring des médias 2

Petit monitoring de notre observatoire des médias sur Twitter.

Chez Mediapart :


plot of chunk unnamed-chunk-7

Le Monde


plot of chunk unnamed-chunk-9

Le Figaro

plot of chunk unnamed-chunk-11

Le parisien

plot of chunk unnamed-chunk-13

Vue globale

plot of chunk unnamed-chunk-15
Le code pour réaliser ce post :
mediapart<-userTimeline(user="mediapart",
n=500,cainfo="cacert.pem")
lemonde<-userTimeline(user="lemondefr",
n=500,cainfo="cacert.pem")
lefigaro<-userTimeline(user="Le_Figaro",
n=500,cainfo="cacert.pem")
leparisien<-userTimeline(user="le_Parisien",
n=500,cainfo="cacert.pem")
#Concaténation
Media.df<-rbind(mediapart.df,
lemonde.df,
lefigaro.df,
leparisien.df)
# Les mots les plus utilisés
mots <- strsplit(mediapart.df$text, " ")
numb = as.character(seq(1,1000,1))
sw<- c("a",stopwords("fr"),numb)
mots <- lapply(mots, function(x) x[grep("^[A-Za-z0-9]+$", x)])
mots <- unlist(mots)
mots <- tolower(mots)
# Réaliser son wordcloud
mots <- mots[!mots %in% sw]
mots.t <- as.data.frame(table(mots))
mots.t <- mots.t[sort.list(mots.t$Freq, decreasing = T),]
pal <- brewer.pal(8, "Dark2")
par(bg = "black")
wordcloud(mots.t$mots,mots.t$Freq, scale=c(6,0.7), min.freq=1, max.words=Inf,
random.order=F, rot.per=0.25, colors=pal, vfont=c("sans serif","plain"))

1 comment:

  1. Oh my goodness! a tremendous article dude. Thank you Nonetheless I'm experiencing difficulty with ur rss . Don know why Unable to subscribe to it. Is there anybody getting equivalent rss problem? Anybody who is aware of kindly respond. Thnkx os path isdir

    ReplyDelete