Monitoring des médias 2

[This article was first published on Learning Data Science , and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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"))

To leave a comment for the author, please follow the link and comment on their blog: Learning Data Science .

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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)