#PDFTribute: Knowledge is free!

En honor a Aaron Swartz,y gracias al mundo R, (1, 2, 3

library(twitteR)
#Post antiguo, cambió el comando
pdftribute2 <- searchTwitter('#pdftribute', n=1500)
df_pdf <- do.call("rbind", lapply(pdftribute2, as.data.frame))
names(df_pdf) head(df_pdf,3)
df_pdf$text=sapply(df_pdf$text,function(row) iconv(row,to='UTF-8'))
trim <- function (x) sub('@','',x) library(stringr)
df_pdf$to=sapply(df_pdf$text,function(tweet)
str_extract(tweet,"^(@[[:alnum:]_]*)"))
df_pdf$to=sapply(df_pdf$to,function(name), trim(name))
df_pdf$rt=sapply(df_pdf$text,function(tweet) trim(str_match(tweet,"^RT (@[[:alnum:]_]*)")[2]))
require(ggplot2) attach(df_pdf) names(df_pdf)
p1<-ggplot(df_pdf, aes(x=na.omit(factor(rt))))
p1+ geom_bar(fill= "#56B4E9", colour="black") + coord_flip() +opts(axis.text.x=theme_text(angle=-90,size=15))+xlab(NULL) + opts(title="First 1500 #pdftribute's RTs", plot.title = theme_text(face="bold", size=14),axis.text.y=theme_text(size=15), axis.title.x = theme_text(face="bold", size=8))
view raw gistfile1.r hosted with ❤ by GitHub



El conocimiento es libre



Comentarios

Entradas populares de este blog

ERROR: Grib2 file or date problem, stopping in edition_num. Can't ungrib.exe SOLVED

ARCGIS: Cálculo de pendiente entre puntos en el espacio xyz

WRF open_aux_u : error opening auxinput5_d02_2013-12-31_00:00:00 for reading. 100