SlideShare a Scribd company logo
1 of 49
Download to read offline
twitteR   R
          Japan.R #2 (2011/11/26)
                        @a_bicky
• Takeshi Arabiki
    ‣

    ‣ Twitter &          : @a_bicky & id:a_bicky

•
                                R

•
                  http://d.hatena.ne.jp/a_bicky/
R
           Osaka.R #4                               Tokyo.R #16                               Tsukuba.R #9




http://www.slideshare.net/abicky/twitterr   http://www.slideshare.net/abicky/r-9034336 http://www.slideshare.net/abicky/r-10128090
R
           Osaka.R #4                               Tokyo.R #16                               Tsukuba.R #9




http://www.slideshare.net/abicky/twitterr   http://www.slideshare.net/abicky/r-9034336 http://www.slideshare.net/abicky/r-10128090



                        http://www.slideshare.net/abicky/rtwitter
LT
twitteR
•                                 RJSONIO
•
•             ID   status ID
• fav               favorited   TRUE
• truncated   TRUE
• DM
• status
  character   factor
twitteR
•                                 RJSONIO
•
•             ID   status ID
• fav               favorited   TRUE
• truncated   TRUE
• DM
• status
  character   factor
OAuth   ”   ”   twitteR   -
OAuth   ”   ”   twitteR   -
OAuth   ”   ”   twitteR   -
OAuth   ”   ”   twitteR   -




                              twittoru
OAuth   ”   ”   twitteR   -
OAuth   ”   ”   twitteR   -
OAuth   ”   ”   twitteR        -




                          twittoru
OAuth   ”   ”   twitteR        -




                          twittoru
OAuth   ”   ”   twitteR        -




R
                          twittoru
OAuth   ”   ”   twitteR        -




                yokkuns
                          twittoru
for Unix users
for Unix users
Windows
$ sudo R -e 'install.packages("twitteR")'
$ sudo R -e 'install.packages("ROAuth")'
RJSONIO

$ sudo R CMD remove RJSONIO # 0.3
$ wget http://cran.r-project.org/src/contrib/Archive/RJSONIO/
RJSONIO_0.3-1.tar.gz
$ sudo R CMD install RJSONIO_0.3-1.tar.gz
twitteR   ROAuth

$ wget https://raw.github.com/gist/1378878 -O ROAuch.patch
$ wget http://cran.r-project.org/src/contrib/
ROAuth_0.9.0.tar.gz
$ tar xvfz ROAuth_0.9.0.tar.gz
$ patch -c -p1 -d ROAuth < ROAuth.patch
$ sudo R CMD remove ROAuth
$ sudo R CMD install ROAuth
$ wget https://raw.github.com/gist/1378880 -O twitteR.patch
$ wget http://cran.r-project.org/src/contrib/
twitteR_0.99.14.tar.gz
$ tar xvfz twitteR_0.99.14.tar.gz
$ patch -c -p1 -d twitteR < twitteR.patch
$ sudo R CMD remove twitteR
$ sudo R CMD install twitteR
https://dev.twitter.com/
https://dev.twitter.com/
https://dev.twitter.com/
https://dev.twitter.com/
←


←


←   URL
←

    Developer Rules Of The Road
            ←
   “Yes, I agree”
            ←                       URL
“Create your Twitter application”
“twitter”
← Consumer key
← Consumer secret
“Read, Write and Access direct messages”
        “Update this Twitter application’s settings”
access token
access token
access token
access token


                                   ← Access token
                                   ← Access token secret


Read, write, and direct messages
twitteR
init_twitteR.R
 library(twitteR)
 library(ROAuth)
 #
 Sys.setlocale("LC_TIME", "en_US.utf-8")

 #
 twit.oauth <- OAuthFactory$new(
          handshakeComplete = TRUE,
          signMethod = "HMAC",
          consumerKey = "vFIR1AYuMJN8X997BjplRw",
          consumerSecret = "p9ZtKxJONDdBO1rIYNiBSmXLJj3W0cKdizremBPb6T4",
          oauthKey = "103027920-8tmAeUQHLxIbDGmjrpJURCKQEDpxu7uHQrGLqphW",
          oauthSecret = "0ixZIMBDRQElQ9P2IrTNIeIvqR7zJzSp6ShNolYcbSE")
 # OAuth
 registerTwitterOAuth(twit.oauth)
twitteR
init_twitteR.R
 library(twitteR)
 library(ROAuth)
 #
 Sys.setlocale("LC_TIME", "en_US.utf-8")

 #
 twit.oauth <- OAuthFactory$new(
          handshakeComplete = TRUE,
          signMethod = "HMAC",
          consumerKey = "vFIR1AYuMJN8X997BjplRw",
          consumerSecret = "p9ZtKxJONDdBO1rIYNiBSmXLJj3W0cKdizremBPb6T4",
          oauthKey = "103027920-8tmAeUQHLxIbDGmjrpJURCKQEDpxu7uHQrGLqphW",
          oauthSecret = "0ixZIMBDRQElQ9P2IrTNIeIvqR7zJzSp6ShNolYcbSE")
 # OAuth
 registerTwitterOAuth(twit.oauth)




                       ※
> source("init_twitteR.R")
> tweet("Japan.R         #japanr")
DM

> taskStatus({
+     x <- sample(as.numeric(1:100), 100000000, replace =
TRUE)
+     ret <- sum(x)
+ }, "a_bicky", sprintf("           %s", ret))
[1] 5049839571
DM

> taskStatus({
+     x <- sample(as.numeric(1:100), 100000000, replace =
TRUE)
+     ret <- sum(x)
+ }, "a_bicky", sprintf("           %s", ret))
[1] 5049839571
R

More Related Content

What's hot

Functional Pe(a)rls - the Purely Functional Datastructures edition
Functional Pe(a)rls - the Purely Functional Datastructures editionFunctional Pe(a)rls - the Purely Functional Datastructures edition
Functional Pe(a)rls - the Purely Functional Datastructures editionosfameron
 
Exploring slides
Exploring slidesExploring slides
Exploring slidesakaptur
 
program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)Ankit Gupta
 
RxSwift 시작하기
RxSwift 시작하기RxSwift 시작하기
RxSwift 시작하기Suyeol Jeon
 
Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2osfameron
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?osfameron
 
dplyr and torrents from cpasbien
dplyr and torrents from cpasbiendplyr and torrents from cpasbien
dplyr and torrents from cpasbienRomain Francois
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)GroovyPuzzlers
 
mobl - model-driven engineering lecture
mobl - model-driven engineering lecturemobl - model-driven engineering lecture
mobl - model-driven engineering lecturezefhemel
 
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...MongoDB
 
M12 random forest-part01
M12 random forest-part01M12 random forest-part01
M12 random forest-part01Raman Kannan
 
M09-Cross validating-naive-bayes
M09-Cross validating-naive-bayesM09-Cross validating-naive-bayes
M09-Cross validating-naive-bayesRaman Kannan
 
Spark DataFrames for Data Munging
Spark DataFrames for Data MungingSpark DataFrames for Data Munging
Spark DataFrames for Data Munging(Susan) Xinh Huynh
 
The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181Mahmoud Samir Fayed
 
(gentle (introduction Clojure))
(gentle (introduction Clojure))(gentle (introduction Clojure))
(gentle (introduction Clojure))Guy Taylor
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveEleanor McHugh
 
MongoUK - PHP Development
MongoUK - PHP DevelopmentMongoUK - PHP Development
MongoUK - PHP DevelopmentBoxed Ice
 
第二讲 预备-Python基礎
第二讲 预备-Python基礎第二讲 预备-Python基礎
第二讲 预备-Python基礎anzhong70
 

What's hot (20)

Functional Pe(a)rls - the Purely Functional Datastructures edition
Functional Pe(a)rls - the Purely Functional Datastructures editionFunctional Pe(a)rls - the Purely Functional Datastructures edition
Functional Pe(a)rls - the Purely Functional Datastructures edition
 
Exploring slides
Exploring slidesExploring slides
Exploring slides
 
program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)
 
RxSwift 시작하기
RxSwift 시작하기RxSwift 시작하기
RxSwift 시작하기
 
Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
 
dplyr and torrents from cpasbien
dplyr and torrents from cpasbiendplyr and torrents from cpasbien
dplyr and torrents from cpasbien
 
The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)The groovy puzzlers (as Presented at JavaOne 2014)
The groovy puzzlers (as Presented at JavaOne 2014)
 
mobl - model-driven engineering lecture
mobl - model-driven engineering lecturemobl - model-driven engineering lecture
mobl - model-driven engineering lecture
 
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
 
M12 random forest-part01
M12 random forest-part01M12 random forest-part01
M12 random forest-part01
 
M09-Cross validating-naive-bayes
M09-Cross validating-naive-bayesM09-Cross validating-naive-bayes
M09-Cross validating-naive-bayes
 
Spark DataFrames for Data Munging
Spark DataFrames for Data MungingSpark DataFrames for Data Munging
Spark DataFrames for Data Munging
 
Malcon2017
Malcon2017Malcon2017
Malcon2017
 
The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181
 
Lập trình Python cơ bản
Lập trình Python cơ bảnLập trình Python cơ bản
Lập trình Python cơ bản
 
(gentle (introduction Clojure))
(gentle (introduction Clojure))(gentle (introduction Clojure))
(gentle (introduction Clojure))
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
 
MongoUK - PHP Development
MongoUK - PHP DevelopmentMongoUK - PHP Development
MongoUK - PHP Development
 
第二讲 预备-Python基礎
第二讲 预备-Python基礎第二讲 预备-Python基礎
第二讲 预备-Python基礎
 

Similar to twitteRで快適Rライフ!

Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018Masashi Shibata
 
Mining the social web ch1
Mining the social web ch1Mining the social web ch1
Mining the social web ch1HyeonSeok Choi
 
GDG DevFest Kyoto 2014 これからのGoの話をしよう
GDG DevFest Kyoto 2014 これからのGoの話をしようGDG DevFest Kyoto 2014 これからのGoの話をしよう
GDG DevFest Kyoto 2014 これからのGoの話をしようSatoshi Noda
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeWim Godden
 
AWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image Converter
AWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image ConverterAWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image Converter
AWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image ConverterSeok-joon Yun
 
Practical Introduction to Web scraping using R
Practical Introduction to Web scraping using RPractical Introduction to Web scraping using R
Practical Introduction to Web scraping using RRsquared Academy
 
Data Mangling with mongoDB the Right Way [PyData London] 2016]
Data Mangling with mongoDB the Right Way [PyData London] 2016]Data Mangling with mongoDB the Right Way [PyData London] 2016]
Data Mangling with mongoDB the Right Way [PyData London] 2016]Alexander Hendorf
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)Joel Lord
 
Grokking Grok: Monitorama PDX 2015
Grokking Grok: Monitorama PDX 2015Grokking Grok: Monitorama PDX 2015
Grokking Grok: Monitorama PDX 2015GregMefford
 
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupДоклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupBadoo Development
 
☣ ppencode ♨
☣ ppencode ♨☣ ppencode ♨
☣ ppencode ♨Audrey Tang
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Yauheni Akhotnikau
 
UAA for Kubernetes
UAA for KubernetesUAA for Kubernetes
UAA for KubernetesAltoros
 
서버리스(Serverless) 웹 애플리케이션 구축하기
서버리스(Serverless) 웹 애플리케이션 구축하기서버리스(Serverless) 웹 애플리케이션 구축하기
서버리스(Serverless) 웹 애플리케이션 구축하기Amazon Web Services Korea
 
Mobile Social Apps and Ads JP version
Mobile Social Apps and Ads JP versionMobile Social Apps and Ads JP version
Mobile Social Apps and Ads JP version01Booster
 

Similar to twitteRで快適Rライフ! (20)

Ruby Robots
Ruby RobotsRuby Robots
Ruby Robots
 
Api
ApiApi
Api
 
Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django REST Framework における API 実装プラクティス | PyCon JP 2018
 
Onsg10 Intro Termtter
Onsg10 Intro TermtterOnsg10 Intro Termtter
Onsg10 Intro Termtter
 
Mining the social web ch1
Mining the social web ch1Mining the social web ch1
Mining the social web ch1
 
Raphaël and You
Raphaël and YouRaphaël and You
Raphaël and You
 
GDG DevFest Kyoto 2014 これからのGoの話をしよう
GDG DevFest Kyoto 2014 これからのGoの話をしようGDG DevFest Kyoto 2014 これからのGoの話をしよう
GDG DevFest Kyoto 2014 これからのGoの話をしよう
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
AWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image Converter
AWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image ConverterAWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image Converter
AWS DEV DAY SEOUL 2017 Buliding Serverless Web App - 직방 Image Converter
 
Practical Introduction to Web scraping using R
Practical Introduction to Web scraping using RPractical Introduction to Web scraping using R
Practical Introduction to Web scraping using R
 
Tribal Leadership with Dave Logan
Tribal Leadership with Dave LoganTribal Leadership with Dave Logan
Tribal Leadership with Dave Logan
 
Data Mangling with mongoDB the Right Way [PyData London] 2016]
Data Mangling with mongoDB the Right Way [PyData London] 2016]Data Mangling with mongoDB the Right Way [PyData London] 2016]
Data Mangling with mongoDB the Right Way [PyData London] 2016]
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
Grokking Grok: Monitorama PDX 2015
Grokking Grok: Monitorama PDX 2015Grokking Grok: Monitorama PDX 2015
Grokking Grok: Monitorama PDX 2015
 
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupДоклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
 
☣ ppencode ♨
☣ ppencode ♨☣ ppencode ♨
☣ ppencode ♨
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
 
UAA for Kubernetes
UAA for KubernetesUAA for Kubernetes
UAA for Kubernetes
 
서버리스(Serverless) 웹 애플리케이션 구축하기
서버리스(Serverless) 웹 애플리케이션 구축하기서버리스(Serverless) 웹 애플리케이션 구축하기
서버리스(Serverless) 웹 애플리케이션 구축하기
 
Mobile Social Apps and Ads JP version
Mobile Social Apps and Ads JP versionMobile Social Apps and Ads JP version
Mobile Social Apps and Ads JP version
 

More from Takeshi Arabiki

クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜
クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜
クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜Takeshi Arabiki
 
Introduction to Japanese Morphological Analysis
Introduction to Japanese Morphological AnalysisIntroduction to Japanese Morphological Analysis
Introduction to Japanese Morphological AnalysisTakeshi Arabiki
 
R による文書分類入門
R による文書分類入門R による文書分類入門
R による文書分類入門Takeshi Arabiki
 
Rのデータ構造とメモリ管理
Rのデータ構造とメモリ管理Rのデータ構造とメモリ管理
Rのデータ構造とメモリ管理Takeshi Arabiki
 
HTML5 Canvas で学ぶアフィン変換
HTML5 Canvas で学ぶアフィン変換HTML5 Canvas で学ぶアフィン変換
HTML5 Canvas で学ぶアフィン変換Takeshi Arabiki
 
Introduction to Favmemo for Immature Engineers
Introduction to Favmemo for Immature EngineersIntroduction to Favmemo for Immature Engineers
Introduction to Favmemo for Immature EngineersTakeshi Arabiki
 
Rのスコープとフレームと環境と
Rのスコープとフレームと環境とRのスコープとフレームと環境と
Rのスコープとフレームと環境とTakeshi Arabiki
 
R版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたR版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたTakeshi Arabiki
 
Rデータフレーム自由自在
Rデータフレーム自由自在Rデータフレーム自由自在
Rデータフレーム自由自在Takeshi Arabiki
 
文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜
文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜
文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜Takeshi Arabiki
 
Rデバッグあれこれ
RデバッグあれこれRデバッグあれこれ
RデバッグあれこれTakeshi Arabiki
 
はじめてのまっぷりでゅ〜す
はじめてのまっぷりでゅ〜すはじめてのまっぷりでゅ〜す
はじめてのまっぷりでゅ〜すTakeshi Arabiki
 
TwitterのデータをRであれこれ
TwitterのデータをRであれこれTwitterのデータをRであれこれ
TwitterのデータをRであれこれTakeshi Arabiki
 
Twitterのデータを取得する準備
Twitterのデータを取得する準備Twitterのデータを取得する準備
Twitterのデータを取得する準備Takeshi Arabiki
 

More from Takeshi Arabiki (16)

開発の心得
開発の心得開発の心得
開発の心得
 
クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜
クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜
クックパッド特売情報 における自然言語処理 〜固有表現抽出を利用した検索システム〜
 
Introduction to Japanese Morphological Analysis
Introduction to Japanese Morphological AnalysisIntroduction to Japanese Morphological Analysis
Introduction to Japanese Morphological Analysis
 
R による文書分類入門
R による文書分類入門R による文書分類入門
R による文書分類入門
 
Rのデータ構造とメモリ管理
Rのデータ構造とメモリ管理Rのデータ構造とメモリ管理
Rのデータ構造とメモリ管理
 
HTML5 Canvas で学ぶアフィン変換
HTML5 Canvas で学ぶアフィン変換HTML5 Canvas で学ぶアフィン変換
HTML5 Canvas で学ぶアフィン変換
 
Introduction to Favmemo for Immature Engineers
Introduction to Favmemo for Immature EngineersIntroduction to Favmemo for Immature Engineers
Introduction to Favmemo for Immature Engineers
 
Rのスコープとフレームと環境と
Rのスコープとフレームと環境とRのスコープとフレームと環境と
Rのスコープとフレームと環境と
 
R版Getopt::Longを作ってみた
R版Getopt::Longを作ってみたR版Getopt::Longを作ってみた
R版Getopt::Longを作ってみた
 
Rデータフレーム自由自在
Rデータフレーム自由自在Rデータフレーム自由自在
Rデータフレーム自由自在
 
HMM, MEMM, CRF メモ
HMM, MEMM, CRF メモHMM, MEMM, CRF メモ
HMM, MEMM, CRF メモ
 
文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜
文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜
文字列カーネルによる辞書なしツイート分類 〜文字列カーネル入門〜
 
Rデバッグあれこれ
RデバッグあれこれRデバッグあれこれ
Rデバッグあれこれ
 
はじめてのまっぷりでゅ〜す
はじめてのまっぷりでゅ〜すはじめてのまっぷりでゅ〜す
はじめてのまっぷりでゅ〜す
 
TwitterのデータをRであれこれ
TwitterのデータをRであれこれTwitterのデータをRであれこれ
TwitterのデータをRであれこれ
 
Twitterのデータを取得する準備
Twitterのデータを取得する準備Twitterのデータを取得する準備
Twitterのデータを取得する準備
 

Recently uploaded

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Recently uploaded (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

twitteRで快適Rライフ!

  • 1. twitteR R Japan.R #2 (2011/11/26) @a_bicky
  • 2. • Takeshi Arabiki ‣ ‣ Twitter & : @a_bicky & id:a_bicky • R • http://d.hatena.ne.jp/a_bicky/
  • 3. R Osaka.R #4 Tokyo.R #16 Tsukuba.R #9 http://www.slideshare.net/abicky/twitterr http://www.slideshare.net/abicky/r-9034336 http://www.slideshare.net/abicky/r-10128090
  • 4. R Osaka.R #4 Tokyo.R #16 Tsukuba.R #9 http://www.slideshare.net/abicky/twitterr http://www.slideshare.net/abicky/r-9034336 http://www.slideshare.net/abicky/r-10128090 http://www.slideshare.net/abicky/rtwitter
  • 5. LT
  • 6. twitteR • RJSONIO • • ID status ID • fav favorited TRUE • truncated TRUE • DM • status character factor
  • 7. twitteR • RJSONIO • • ID status ID • fav favorited TRUE • truncated TRUE • DM • status character factor
  • 8. OAuth ” ” twitteR -
  • 9. OAuth ” ” twitteR -
  • 10. OAuth ” ” twitteR -
  • 11. OAuth ” ” twitteR - twittoru
  • 12. OAuth ” ” twitteR -
  • 13. OAuth ” ” twitteR -
  • 14. OAuth ” ” twitteR - twittoru
  • 15. OAuth ” ” twitteR - twittoru
  • 16. OAuth ” ” twitteR - R twittoru
  • 17. OAuth ” ” twitteR - yokkuns twittoru
  • 18.
  • 19.
  • 22. $ sudo R -e 'install.packages("twitteR")' $ sudo R -e 'install.packages("ROAuth")'
  • 23. RJSONIO $ sudo R CMD remove RJSONIO # 0.3 $ wget http://cran.r-project.org/src/contrib/Archive/RJSONIO/ RJSONIO_0.3-1.tar.gz $ sudo R CMD install RJSONIO_0.3-1.tar.gz
  • 24. twitteR ROAuth $ wget https://raw.github.com/gist/1378878 -O ROAuch.patch $ wget http://cran.r-project.org/src/contrib/ ROAuth_0.9.0.tar.gz $ tar xvfz ROAuth_0.9.0.tar.gz $ patch -c -p1 -d ROAuth < ROAuth.patch $ sudo R CMD remove ROAuth $ sudo R CMD install ROAuth $ wget https://raw.github.com/gist/1378880 -O twitteR.patch $ wget http://cran.r-project.org/src/contrib/ twitteR_0.99.14.tar.gz $ tar xvfz twitteR_0.99.14.tar.gz $ patch -c -p1 -d twitteR < twitteR.patch $ sudo R CMD remove twitteR $ sudo R CMD install twitteR
  • 29.
  • 30.
  • 31. ← ← ← URL
  • 32. Developer Rules Of The Road ← “Yes, I agree” ← URL “Create your Twitter application”
  • 33.
  • 35.
  • 36. ← Consumer key ← Consumer secret
  • 37.
  • 38. “Read, Write and Access direct messages” “Update this Twitter application’s settings”
  • 42. access token ← Access token ← Access token secret Read, write, and direct messages
  • 43. twitteR init_twitteR.R library(twitteR) library(ROAuth) # Sys.setlocale("LC_TIME", "en_US.utf-8") # twit.oauth <- OAuthFactory$new( handshakeComplete = TRUE, signMethod = "HMAC", consumerKey = "vFIR1AYuMJN8X997BjplRw", consumerSecret = "p9ZtKxJONDdBO1rIYNiBSmXLJj3W0cKdizremBPb6T4", oauthKey = "103027920-8tmAeUQHLxIbDGmjrpJURCKQEDpxu7uHQrGLqphW", oauthSecret = "0ixZIMBDRQElQ9P2IrTNIeIvqR7zJzSp6ShNolYcbSE") # OAuth registerTwitterOAuth(twit.oauth)
  • 44. twitteR init_twitteR.R library(twitteR) library(ROAuth) # Sys.setlocale("LC_TIME", "en_US.utf-8") # twit.oauth <- OAuthFactory$new( handshakeComplete = TRUE, signMethod = "HMAC", consumerKey = "vFIR1AYuMJN8X997BjplRw", consumerSecret = "p9ZtKxJONDdBO1rIYNiBSmXLJj3W0cKdizremBPb6T4", oauthKey = "103027920-8tmAeUQHLxIbDGmjrpJURCKQEDpxu7uHQrGLqphW", oauthSecret = "0ixZIMBDRQElQ9P2IrTNIeIvqR7zJzSp6ShNolYcbSE") # OAuth registerTwitterOAuth(twit.oauth) ※
  • 46.
  • 47. DM > taskStatus({ + x <- sample(as.numeric(1:100), 100000000, replace = TRUE) + ret <- sum(x) + }, "a_bicky", sprintf(" %s", ret)) [1] 5049839571
  • 48. DM > taskStatus({ + x <- sample(as.numeric(1:100), 100000000, replace = TRUE) + ret <- sum(x) + }, "a_bicky", sprintf(" %s", ret)) [1] 5049839571
  • 49. R