Upload
others
View
18
Download
0
Embed Size (px)
Citation preview
R, twitteR and igraphJust-In Time Sociology @EPFL
Yannick Rochat1,2,3,Martin Grandjean2,3,Vincent Barbay3,4
1DHLab, EPFL,2 UNIL,3 Pegasus Data Project,4OZWE, Lausanne
December 4, 2012
Examples
R & twitteR
Just-in time #JITSO12
Conclusion
Examples
ContentTweets containing hashtag #EnLD (= En Ligne Directe)
3 / 29
Examples
Timestamp0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
sam 6 oct
ven 5 octRubik
jeu 4 octvente terrain
mer 3 octvaccins
mar 2 octMörgeli
lun 1 octalcool
dim 30 sep
sam 29 sep
ven 28 sep
4 / 29
Examples
Predictions (?)
5 / 29
Examples
Mentions (network)
6 / 29
Examples
R & twitteR
Just-in time #JITSO12
Conclusion
Twitter 3rd-party appsA few examples. . .
• TweetBackup
• Tweet Archivist
• Topsy
• Yahoo pipes (RSS)• IFTTT.com
• i.e. online scripts that can send archives toevernote, dropbox, etc.
8 / 29
API
• API = Application Programming Interface
• dev.twitter.com• good coding skills needed
• REST API• Streaming API• OAuth• JSON
9 / 29
APIA sample of PHP code used by the Pegasus Data Project
10 / 29
APIJSON (output format)
11 / 29
Examples
R & twitteR
Just-in time #JITSO12
Conclusion
R & twitteR
Installhttp://r-project.org
13 / 29
R & twitteR
As Quora says...
I R is a data analysis software.
I R is a programming language.
I R is an environment for statistical analysis.
I R is an open-source software project.
I R is a worldwide community of statisticians,
data analysts and data scientists.
http://www.quora.com/R-software/What-is-R/
answer/David-Smith-3114 / 29
R & twitteR
Strong community
I Developers
I Users
I Forums, mailing-lists
I #rstats
I quora, stackoverflow
15 / 29
R & twitteR
InstalltwitteR
Installing is necessary only once.
Loading1 has to be done every session, or once for all via package options.
1library()16 / 29
R & twitteR
searchTwitter
17 / 29
R & twitteR
searchTwitter
18 / 29
R & twitteR
searchTwitter
19 / 29
R & twitteR
searchTwitterMore generally. . .
20 / 29
R & twitteR
list → data frames
21 / 29
Examples
R & twitteR
Just-in time #JITSO12
Conclusion
Just-in time #JITSO12
ContentWord cloud
23 / 29
Just-in time #JITSO12
Timestamp
24 / 29
Just-in time #JITSO12
NetworkWho mentions whom ?
25 / 29
Just-in time #JITSO12
Others directions
I Cascades / trends / diffusion
I Text mining
I Dynamics
I Prediction
I Geolocation
I . . .
26 / 29
Examples
R & twitteR
Just-in time #JITSO12
Conclusion
Conclusion
References
I Csardi G, Nepusz T, The igraph software packagefor complex network research, InterJournal,Complex Systems 1695. 2006.http://igraph.sf.net
I Gentry J, twitteR: R based Twitter client. Rpackage version 0.99.19. 2012.http://CRAN.R-project.org/package=twitteR
I Grandjean M, Rochat Y, Barbay V, The PegasusData Project. 2012. http://pegasusdata.com
28 / 29