Chez Mediapart :
Le Monde
Le Figaro
Le parisien
Vue globale
Le code pour réaliser ce post :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
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