SlideShare a Scribd company logo
2011-06-17 HiRoshima.R #1@



Saturday, June 18, 2011                                1
Agenda
          1. R             ―       ―

          2. R

          3. R

Saturday, June 18, 2011                2
Agenda
          1. R             ―       ―

          2. R

          3. R

Saturday, June 18, 2011                3
Saturday, June 18, 2011   4
t




Saturday, June 18, 2011       5
Saturday, June 18, 2011   6
•
                 •

                 •        A   B

           •

Saturday, June 18, 2011           7
:       “however”



                              109    347        8    493

                          [   ] However, ....
                          [   ] ..., however, ....
                          [   ] ..., however.

Saturday, June 18, 2011                                    8
> freq <- c(109,347,8)
    > chisq.test(freq,correct=FALSE)

            Chi-squared test for given probabilities

        data:             freq
        X-squared = 391.7371, df = 2, p-value < 2.2e-16


    #                                               2
    #      http://homepage2.nifty.com/nandemoarchive/toukei_kiso/t_F_chi.htm




Saturday, June 18, 2011                                                        9
Saturday, June 18, 2011   10
Agenda
          1. R             ―       ―

          2. R

          3. R

Saturday, June 18, 2011                11
Agenda
          1. R             ―       ―

          2. R

          3. R

Saturday, June 18, 2011                12
Saturday, June 18, 2011   13
1.
                          2.
                          3.
                          4.
                          5.
                          6.

Saturday, June 18, 2011        14
1.
              •
                          • ns <- scan("ns_raw.txt", what="character")
              •
                          • ns <- scan(choose.files(), what="char")
              •
                    • getwd()                                            !


Saturday, June 18, 2011                                                      15
2.

               •          head(           ,       )

               • tail(                ,       )
                          •       /



Saturday, June 18, 2011                               16
2.
                    •grep (“              ”,          )
                          •
                                   > grep("school", ns)


                          •   ns
                               > ns[grep("school", ns)]


Saturday, June 18, 2011                                   17
2.
            •              [       ]

                  • > ns[100]
                     • 100
                  • > ns[c(98,99,100)]
                     • 98, 99, 100
                     •c
Saturday, June 18, 2011                  18
3.
                    •
                    •strsplit (           ,“             ”)

                                  > strsplit (ns, " ")

                          •ns
                          •
                          •            list

Saturday, June 18, 2011                                       19
3.
     •
                             > ns_list <- strsplit (ns, " ")

                   •                     ns_list

                                    > unlist (ns_list)

                  • ns_list
                  • unlist(strsplit(ns, " "))
Saturday, June 18, 2011                                        20
4.


                          sort (       )
                          > ns2 <- sort(unlist(ns_list))




Saturday, June 18, 2011                                    21
4.

     unique (                  )
     > ns3 <- unique (sort(unlist(ns_list)))
     #                            (          )
     # sort(unique(unlist(ns_list)))




Saturday, June 18, 2011                          22
5.
                 table (        )
                 > ns4 <- table(unlist(strsplit (ns, " ")))

                 #                                  table
                 #




Saturday, June 18, 2011                                       23
5.

                 > ns5 <- length(unlist(strsplit (ns, " ")))

                 #




Saturday, June 18, 2011                                        24
5.

     > ns6 <- length(unique(sort(unlist(strsplit (ns, " ")))))

     #
     #

        > ns7 <- unique(sort(unlist (ns_list)))
        > length(ns7)


Saturday, June 18, 2011                                          25
6.
             > write.table(ns4, file=“freq1.txt”)
             > write.table(ns5, file=“freq2.txt”)
             > write.table(ns6, file=“freq3.txt”)

             # getwd()
             # Excel




Saturday, June 18, 2011                            26
Saturday, June 18, 2011   27
Agenda
          1. R             ―       ―

          2. R

          3. R

Saturday, June 18, 2011                28
Agenda
          1. R             ―       ―

          2. R

          3. R

Saturday, June 18, 2011                29
•
                          •
                          •
                          •
                              •   ... orz


Saturday, June 18, 2011                     30
RMeCab

Saturday, June 18, 2011            31
RMeCab
                 •
                  •R           MeCab



                          •        R



Saturday, June 18, 2011                32
• RMeCabText() :
          • RMeCabFreq() :

          • Ngram() : N-gram

          • collocate() :

Saturday, June 18, 2011        33
Saturday, June 18, 2011   34
2,940    1,785   3,780

Saturday, June 18, 2011                   35
Saturday, June 18, 2011   36
twitter: @sakaue

                          e-mail: tsakaue<AT>hiroshima-u.ac.jp




Saturday, June 18, 2011                                          37

More Related Content

More from SAKAUE, Tatsuya

HiroshimaR6_Introduction
HiroshimaR6_IntroductionHiroshimaR6_Introduction
HiroshimaR6_Introduction
SAKAUE, Tatsuya
 
HiroshimaR5_Intro
HiroshimaR5_IntroHiroshimaR5_Intro
HiroshimaR5_Intro
SAKAUE, Tatsuya
 
JASELE2015-KumamotoWS
JASELE2015-KumamotoWSJASELE2015-KumamotoWS
JASELE2015-KumamotoWS
SAKAUE, Tatsuya
 
HiroshimaR4_LT_sakaue
HiroshimaR4_LT_sakaueHiroshimaR4_LT_sakaue
HiroshimaR4_LT_sakaue
SAKAUE, Tatsuya
 
Hiroshimar4_Rintro
Hiroshimar4_RintroHiroshimar4_Rintro
Hiroshimar4_Rintro
SAKAUE, Tatsuya
 
Hiroshimar3_rmecab
Hiroshimar3_rmecabHiroshimar3_rmecab
Hiroshimar3_rmecab
SAKAUE, Tatsuya
 
HiRoshimaR3_IntroR
HiRoshimaR3_IntroRHiRoshimaR3_IntroR
HiRoshimaR3_IntroR
SAKAUE, Tatsuya
 
MethokenOkinawa_Sakaue_LearnerCorpus
MethokenOkinawa_Sakaue_LearnerCorpusMethokenOkinawa_Sakaue_LearnerCorpus
MethokenOkinawa_Sakaue_LearnerCorpusSAKAUE, Tatsuya
 
外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」
外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」
外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」
SAKAUE, Tatsuya
 
統計解析環境Rによる統計処理の基本―検定と視覚化―
統計解析環境Rによる統計処理の基本―検定と視覚化―統計解析環境Rによる統計処理の基本―検定と視覚化―
統計解析環境Rによる統計処理の基本―検定と視覚化―
SAKAUE, Tatsuya
 
統計解析環境Rによる言語データの分析
統計解析環境Rによる言語データの分析統計解析環境Rによる言語データの分析
統計解析環境Rによる言語データの分析
SAKAUE, Tatsuya
 
ポッドキャスト利用による個別学習の支援とリスニング不安への影響
ポッドキャスト利用による個別学習の支援とリスニング不安への影響ポッドキャスト利用による個別学習の支援とリスニング不安への影響
ポッドキャスト利用による個別学習の支援とリスニング不安への影響
SAKAUE, Tatsuya
 
Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」
Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」
Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」SAKAUE, Tatsuya
 
ベクタ画像と PNG 画像の比較
ベクタ画像と PNG 画像の比較ベクタ画像と PNG 画像の比較
ベクタ画像と PNG 画像の比較
SAKAUE, Tatsuya
 
反応時間データをどう分析し図示するか
反応時間データをどう分析し図示するか反応時間データをどう分析し図示するか
反応時間データをどう分析し図示するか
SAKAUE, Tatsuya
 
LET2012 ワークショップ「R による教育・言語データ処理のススメ」
LET2012 ワークショップ「R による教育・言語データ処理のススメ」LET2012 ワークショップ「R による教育・言語データ処理のススメ」
LET2012 ワークショップ「R による教育・言語データ処理のススメ」SAKAUE, Tatsuya
 
授業外で個別学習を促進するためのポッドキャスト利用
授業外で個別学習を促進するためのポッドキャスト利用授業外で個別学習を促進するためのポッドキャスト利用
授業外で個別学習を促進するためのポッドキャスト利用SAKAUE, Tatsuya
 
R のインストール手順(LET 2012用)
R のインストール手順(LET 2012用)R のインストール手順(LET 2012用)
R のインストール手順(LET 2012用)
SAKAUE, Tatsuya
 
Nagoya.R #8 入門者講習資料
Nagoya.R #8 入門者講習資料Nagoya.R #8 入門者講習資料
Nagoya.R #8 入門者講習資料
SAKAUE, Tatsuya
 
「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...
「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...
「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...SAKAUE, Tatsuya
 

More from SAKAUE, Tatsuya (20)

HiroshimaR6_Introduction
HiroshimaR6_IntroductionHiroshimaR6_Introduction
HiroshimaR6_Introduction
 
HiroshimaR5_Intro
HiroshimaR5_IntroHiroshimaR5_Intro
HiroshimaR5_Intro
 
JASELE2015-KumamotoWS
JASELE2015-KumamotoWSJASELE2015-KumamotoWS
JASELE2015-KumamotoWS
 
HiroshimaR4_LT_sakaue
HiroshimaR4_LT_sakaueHiroshimaR4_LT_sakaue
HiroshimaR4_LT_sakaue
 
Hiroshimar4_Rintro
Hiroshimar4_RintroHiroshimar4_Rintro
Hiroshimar4_Rintro
 
Hiroshimar3_rmecab
Hiroshimar3_rmecabHiroshimar3_rmecab
Hiroshimar3_rmecab
 
HiRoshimaR3_IntroR
HiRoshimaR3_IntroRHiRoshimaR3_IntroR
HiRoshimaR3_IntroR
 
MethokenOkinawa_Sakaue_LearnerCorpus
MethokenOkinawa_Sakaue_LearnerCorpusMethokenOkinawa_Sakaue_LearnerCorpus
MethokenOkinawa_Sakaue_LearnerCorpus
 
外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」
外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」
外国語教育メディア学会第54回全国研究大会ワークショップ「Rによる外国語教育データの分析と可視化の基本」
 
統計解析環境Rによる統計処理の基本―検定と視覚化―
統計解析環境Rによる統計処理の基本―検定と視覚化―統計解析環境Rによる統計処理の基本―検定と視覚化―
統計解析環境Rによる統計処理の基本―検定と視覚化―
 
統計解析環境Rによる言語データの分析
統計解析環境Rによる言語データの分析統計解析環境Rによる言語データの分析
統計解析環境Rによる言語データの分析
 
ポッドキャスト利用による個別学習の支援とリスニング不安への影響
ポッドキャスト利用による個別学習の支援とリスニング不安への影響ポッドキャスト利用による個別学習の支援とリスニング不安への影響
ポッドキャスト利用による個別学習の支援とリスニング不安への影響
 
Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」
Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」
Nagoya.R #10 LT 「グラフはベクタ(ベクトル)画像で出力しようじゃありませんか」
 
ベクタ画像と PNG 画像の比較
ベクタ画像と PNG 画像の比較ベクタ画像と PNG 画像の比較
ベクタ画像と PNG 画像の比較
 
反応時間データをどう分析し図示するか
反応時間データをどう分析し図示するか反応時間データをどう分析し図示するか
反応時間データをどう分析し図示するか
 
LET2012 ワークショップ「R による教育・言語データ処理のススメ」
LET2012 ワークショップ「R による教育・言語データ処理のススメ」LET2012 ワークショップ「R による教育・言語データ処理のススメ」
LET2012 ワークショップ「R による教育・言語データ処理のススメ」
 
授業外で個別学習を促進するためのポッドキャスト利用
授業外で個別学習を促進するためのポッドキャスト利用授業外で個別学習を促進するためのポッドキャスト利用
授業外で個別学習を促進するためのポッドキャスト利用
 
R のインストール手順(LET 2012用)
R のインストール手順(LET 2012用)R のインストール手順(LET 2012用)
R のインストール手順(LET 2012用)
 
Nagoya.R #8 入門者講習資料
Nagoya.R #8 入門者講習資料Nagoya.R #8 入門者講習資料
Nagoya.R #8 入門者講習資料
 
「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...
「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...
「R による英語コーパスの処理入門―接続詞 and/but の使用実態調査を例に―」Computing Language and Culture with...
 

Recently uploaded

Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 

Recently uploaded (20)

Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 

HiRoshima.R #1 1-3 LT

  • 2. Agenda 1. R ― ― 2. R 3. R Saturday, June 18, 2011 2
  • 3. Agenda 1. R ― ― 2. R 3. R Saturday, June 18, 2011 3
  • 7. • • A B • Saturday, June 18, 2011 7
  • 8. : “however” 109 347 8 493 [ ] However, .... [ ] ..., however, .... [ ] ..., however. Saturday, June 18, 2011 8
  • 9. > freq <- c(109,347,8) > chisq.test(freq,correct=FALSE) Chi-squared test for given probabilities data: freq X-squared = 391.7371, df = 2, p-value < 2.2e-16 # 2 # http://homepage2.nifty.com/nandemoarchive/toukei_kiso/t_F_chi.htm Saturday, June 18, 2011 9
  • 11. Agenda 1. R ― ― 2. R 3. R Saturday, June 18, 2011 11
  • 12. Agenda 1. R ― ― 2. R 3. R Saturday, June 18, 2011 12
  • 14. 1. 2. 3. 4. 5. 6. Saturday, June 18, 2011 14
  • 15. 1. • • ns <- scan("ns_raw.txt", what="character") • • ns <- scan(choose.files(), what="char") • • getwd() ! Saturday, June 18, 2011 15
  • 16. 2. • head( , ) • tail( , ) • / Saturday, June 18, 2011 16
  • 17. 2. •grep (“ ”, ) • > grep("school", ns) • ns > ns[grep("school", ns)] Saturday, June 18, 2011 17
  • 18. 2. • [ ] • > ns[100] • 100 • > ns[c(98,99,100)] • 98, 99, 100 •c Saturday, June 18, 2011 18
  • 19. 3. • •strsplit ( ,“ ”) > strsplit (ns, " ") •ns • • list Saturday, June 18, 2011 19
  • 20. 3. • > ns_list <- strsplit (ns, " ") • ns_list > unlist (ns_list) • ns_list • unlist(strsplit(ns, " ")) Saturday, June 18, 2011 20
  • 21. 4. sort ( ) > ns2 <- sort(unlist(ns_list)) Saturday, June 18, 2011 21
  • 22. 4. unique ( ) > ns3 <- unique (sort(unlist(ns_list))) # ( ) # sort(unique(unlist(ns_list))) Saturday, June 18, 2011 22
  • 23. 5. table ( ) > ns4 <- table(unlist(strsplit (ns, " "))) # table # Saturday, June 18, 2011 23
  • 24. 5. > ns5 <- length(unlist(strsplit (ns, " "))) # Saturday, June 18, 2011 24
  • 25. 5. > ns6 <- length(unique(sort(unlist(strsplit (ns, " "))))) # # > ns7 <- unique(sort(unlist (ns_list))) > length(ns7) Saturday, June 18, 2011 25
  • 26. 6. > write.table(ns4, file=“freq1.txt”) > write.table(ns5, file=“freq2.txt”) > write.table(ns6, file=“freq3.txt”) # getwd() # Excel Saturday, June 18, 2011 26
  • 28. Agenda 1. R ― ― 2. R 3. R Saturday, June 18, 2011 28
  • 29. Agenda 1. R ― ― 2. R 3. R Saturday, June 18, 2011 29
  • 30. • • • • ... orz Saturday, June 18, 2011 30
  • 32. RMeCab • •R MeCab • R Saturday, June 18, 2011 32
  • 33. • RMeCabText() : • RMeCabFreq() : • Ngram() : N-gram • collocate() : Saturday, June 18, 2011 33
  • 35. 2,940 1,785 3,780 Saturday, June 18, 2011 35
  • 37. twitter: @sakaue e-mail: tsakaue<AT>hiroshima-u.ac.jp Saturday, June 18, 2011 37