SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
TOKYO.R #18
1. 
2. 
3.             R
      i. 
      ii. 
      iii.     demo())
      iv. 
      v. 
      vi. 
      vii.         fucntion)
      viii. 
4. 
5. 
                                         Mac
                               Windows
•                :
•  Twitter       :aad34210
•                :http://pracmper.blogspot.com/
•                :
•                :
•                :                  Web
•  R


•  R

• 
R




• 

•        R
     …
• 

•                    …




                         TokyoR




     Amazon
          (¥3,990)
R                 -       
•  R



 http://www.r-project.org/
R       -   
• 
     ������                       




          R
R       -       
•        …




                 R


                         ������ command + enter
R            -           
       quit()           R   R




•  R

•               R
R               -                    
•            iris
•    R                                   demo()




                    demo(graphics)
R   -   
•  Retern
R      -                          
• 
•  “Iris”


  iris
         head(iris , 10)
   tail(iris , 10)
R           -                                
   • 
   • 


Iris$Sepal.Length
     Iris[,1] | iris[1,1]
      head(iris[,1] , 10)




                     Iris[ , ]

                                               Iris
R   –                               
• 
•  R
•          apply

                   apply               ,            ,

                   •  apply(iris[1:4] , 2 , sum)
                        

                   •  apply(iris[1:4] , 2 , mean)
                        

                   •  apply(iris[1:4] , 2 , sd)
                        

                   •  apply(iris[1:4] , 2 ,quantile)
                        
R   –                               
• 
•  R
•          apply

                   apply               ,            ,

                   •  apply(iris[1:4] , 2 , sum)
                        

                   •  apply(iris[1:4] , 2 , mean)
                        

                   •  apply(iris[1:4] , 2 , sd)
                        

                   •  apply(iris[1:4] , 2 ,quantile)
                        
R              –                                  
• 
•        tapply()


                        tapply                ,                 ,

                        •  tapply(iris[,1] , iris[,5] , sum)
                              

                        •  tapply(iris[,1] , iris[,5] , mean)
                              

                        •  tapply(iris[,1] , iris[,5] , sd)
                              

                        •  tapply(iris[,1] , iris[,5] , quantile)
                              
R             –                                    
•  aggregate()
• 


                 aggregate(            ,            ,     )

                 •  aggregate(iris[,1:4] , list(name = iris$Species) , sum)
                      

                 •  aggregate(iris[,1:4] , list(name = iris$Species) , mean)
                      

                 •  aggregate(iris[,1:4] , list(name = iris$Species) , sd)
                      

                 •  aggregate(iris[,1:4] , list(name = iris$Species) , quantile)
                      
R                  –                               
    • 
    •  ggplot2              ”plyr”      SQL                  ”sqldf”


■            ggplot2
                     ■             sqldf
ddply(full_list,                          sqldf SELECT
c("Subject","Class"),                               Species ,
 function(df)                                       COUNT(*) as num
return(c(AVERAGE=mean(df                         FROM
$RT))))
                                            iris
                                                 GROUP BY
                                                    Species


■                                             ■
  http://cran.r-project.org/web/               http://code.google.com/p/sqldf/
   packages/plyr/index.html                     http://www.slideshare.net/aad34210/
  http://plyr.had.co.nz/
                       tokyo-r-sqldf
                                                            TokyoR
R          –              
•                              sum() , mean()
•  R           Excel
• 

       
               
                                        
Sum()      
                                            Sum(iris[,1])
                                                        
Mean() 
                                            
   Mean(iris[,1])
sd() 
                                              
   Sd(iris[,1])
                                                        
Var()
                                          
       Var(iris[,1])
Max() 
                                                 max(iris[,1])
Min()
                                                  Min(iris[,1])
Rank()
                                                 rank(iris[,1])
Cor()
                                                  cor(iris[,1] , iris[,
                                                        2])
R                –              
• 

•  http://cran.r-project.org/doc/contrib/Short-refcard.pdf
    ������ Math
    ������ R
        Cheet Sheet
R                    –                        FUNCTION)
•  R                                                              …
• 
������           function
• 



judge_value <- function(v) {                       Judge_value
                 z <- ifelse(v >= 0 , "+" , "-")            v 0
                 print(z)
                 }

judge_value(v <- -10)         −
judge_value(v <- 10)

                             +
R        –       FUNCTION)
•                     …
•    Function()
R                          –                                
     •                           R
     • 

              

     •                                                              R


■                                           

                                                R
                                                                                          
         
                   
                                       
•                                           •  Install.packages()   •              Vignettes   • 
•         CRAN Task View
            •  http://cran.r-project.org/
               web/views/
•                                                                   •  http://cran.r-
•         Twitter Facebook                                             project.org/web/
•         Yahoo!                                                       packages/zoo/
                                                                       index.html
R           –             
•  Install.packages()
•  ggplot2
                            •  install.packages("ggplot2”)


                            • 

                            •  Library(ggplot2)
•    R
•            R




• 
• 
• 
• 
• 

     1.        CRAN         R                   DL

     2.        demo()

     3.        iris , iris$Sepal.length , iris[1,1] , head(iris , 10)

     4.        apply    , aggregate , plyr , sqldf

     5.        sum() , mean() , sd() …

     6.        function()

     7.        install.packages()
m(___)m

Weitere ähnliche Inhalte

Andere mochten auch

Rで解く最適化問題 線型計画問題編
Rで解く最適化問題   線型計画問題編 Rで解く最適化問題   線型計画問題編
Rで解く最適化問題 線型計画問題編
Hidekazu Tanaka
 
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
horihorio
 
パターン認識 08 09 k-近傍法 lvq
パターン認識 08 09 k-近傍法 lvqパターン認識 08 09 k-近傍法 lvq
パターン認識 08 09 k-近傍法 lvq
sleipnir002
 

Andere mochten auch (20)

Tokyo r 10_12
Tokyo r 10_12Tokyo r 10_12
Tokyo r 10_12
 
Tokyor16
Tokyor16Tokyor16
Tokyor16
 
Rで解く最適化問題 線型計画問題編
Rで解く最適化問題   線型計画問題編 Rで解く最適化問題   線型計画問題編
Rで解く最適化問題 線型計画問題編
 
Tokyo r21 2
Tokyo r21 2Tokyo r21 2
Tokyo r21 2
 
3次元のデータをグラフにする(Tokyo.R#17)
3次元のデータをグラフにする(Tokyo.R#17)3次元のデータをグラフにする(Tokyo.R#17)
3次元のデータをグラフにする(Tokyo.R#17)
 
Rデバッグあれこれ
RデバッグあれこれRデバッグあれこれ
Rデバッグあれこれ
 
R6パッケージの紹介―機能と実装
R6パッケージの紹介―機能と実装R6パッケージの紹介―機能と実装
R6パッケージの紹介―機能と実装
 
近似ベイズ計算によるベイズ推定
近似ベイズ計算によるベイズ推定近似ベイズ計算によるベイズ推定
近似ベイズ計算によるベイズ推定
 
Tokyo webmining 複雑ネットワークとデータマイニング
Tokyo webmining 複雑ネットワークとデータマイニングTokyo webmining 複雑ネットワークとデータマイニング
Tokyo webmining 複雑ネットワークとデータマイニング
 
Tokyo r28 1
Tokyo r28 1Tokyo r28 1
Tokyo r28 1
 
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
 
Tokyo r24 r_graph_tutorial
Tokyo r24 r_graph_tutorialTokyo r24 r_graph_tutorial
Tokyo r24 r_graph_tutorial
 
ggplot2 110129
ggplot2 110129ggplot2 110129
ggplot2 110129
 
[db tech showcase Tokyo 2015] C32:「データ一貫性にこだわる日立のインメモリ分散KVS~こだわりの理由と実現方法とは~」 ...
[db tech showcase Tokyo 2015] C32:「データ一貫性にこだわる日立のインメモリ分散KVS~こだわりの理由と実現方法とは~」 ...[db tech showcase Tokyo 2015] C32:「データ一貫性にこだわる日立のインメモリ分散KVS~こだわりの理由と実現方法とは~」 ...
[db tech showcase Tokyo 2015] C32:「データ一貫性にこだわる日立のインメモリ分散KVS~こだわりの理由と実現方法とは~」 ...
 
Tokyo r21 修正版
Tokyo r21 修正版Tokyo r21 修正版
Tokyo r21 修正版
 
RをAWSで使おう
RをAWSで使おうRをAWSで使おう
RをAWSで使おう
 
ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発
ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発
ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発
 
パターン認識 08 09 k-近傍法 lvq
パターン認識 08 09 k-近傍法 lvqパターン認識 08 09 k-近傍法 lvq
パターン認識 08 09 k-近傍法 lvq
 
R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜
R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜
R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜
 
Tokyo r33 beginner
Tokyo r33 beginnerTokyo r33 beginner
Tokyo r33 beginner
 

Ähnlich wie Tokyo r18

楽々Scalaプログラミング
楽々Scalaプログラミング楽々Scalaプログラミング
楽々Scalaプログラミング
Tomoharu ASAMI
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introduction
elliando dias
 
Datamining R 4th
Datamining R 4thDatamining R 4th
Datamining R 4th
sesejun
 
R - Basic Introduction
R - Basic IntroductionR - Basic Introduction
R - Basic Introduction
KU by ADDI
 
Extend R with C!!!
Extend R with C!!!Extend R with C!!!
Extend R with C!!!
mickey24
 
Unit 4 hw 1 - coordinate plane, d&r, midpoint
Unit 4   hw 1 - coordinate plane, d&r, midpointUnit 4   hw 1 - coordinate plane, d&r, midpoint
Unit 4 hw 1 - coordinate plane, d&r, midpoint
Lori Rapp
 

Ähnlich wie Tokyo r18 (20)

楽々Scalaプログラミング
楽々Scalaプログラミング楽々Scalaプログラミング
楽々Scalaプログラミング
 
From Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn IntroductionFrom Lisp to Clojure/Incanter and RAn Introduction
From Lisp to Clojure/Incanter and RAn Introduction
 
Great BigTable and my toys
Great BigTable and my toysGreat BigTable and my toys
Great BigTable and my toys
 
Using Raspberry Pi GPU for DNN
Using Raspberry Pi GPU for DNNUsing Raspberry Pi GPU for DNN
Using Raspberry Pi GPU for DNN
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)
 
Rug hogan-10-03-2012
Rug hogan-10-03-2012Rug hogan-10-03-2012
Rug hogan-10-03-2012
 
R v01 rprogamming_basic01 (R 프로그래밍 기본)
R v01 rprogamming_basic01 (R 프로그래밍 기본)R v01 rprogamming_basic01 (R 프로그래밍 기본)
R v01 rprogamming_basic01 (R 프로그래밍 기본)
 
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
 
Datamining R 4th
Datamining R 4thDatamining R 4th
Datamining R 4th
 
Hadoop london
Hadoop londonHadoop london
Hadoop london
 
R - Basic Introduction
R - Basic IntroductionR - Basic Introduction
R - Basic Introduction
 
Extend R with C!!!
Extend R with C!!!Extend R with C!!!
Extend R with C!!!
 
R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for Beginners
 
tutorial5
tutorial5tutorial5
tutorial5
 
tutorial5
tutorial5tutorial5
tutorial5
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Geoff Rothman Presentation on Parallel Processing
Geoff Rothman Presentation on Parallel ProcessingGeoff Rothman Presentation on Parallel Processing
Geoff Rothman Presentation on Parallel Processing
 
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
 
Prolog 7-Languages
Prolog 7-LanguagesProlog 7-Languages
Prolog 7-Languages
 
Unit 4 hw 1 - coordinate plane, d&r, midpoint
Unit 4   hw 1 - coordinate plane, d&r, midpointUnit 4   hw 1 - coordinate plane, d&r, midpoint
Unit 4 hw 1 - coordinate plane, d&r, midpoint
 

Mehr von Takashi Minoda

Mehr von Takashi Minoda (20)

Introduction r (R入門)
Introduction r (R入門)Introduction r (R入門)
Introduction r (R入門)
 
RStudioでRをはじめよう(R for Beginner using RStudio)
RStudioでRをはじめよう(R for Beginner using RStudio)RStudioでRをはじめよう(R for Beginner using RStudio)
RStudioでRをはじめよう(R for Beginner using RStudio)
 
RからGoogle Cloud Vision API を利用する
RからGoogle Cloud Vision API を利用するRからGoogle Cloud Vision API を利用する
RからGoogle Cloud Vision API を利用する
 
TokyoR:RMarkdownでレポート作成
TokyoR:RMarkdownでレポート作成TokyoR:RMarkdownでレポート作成
TokyoR:RMarkdownでレポート作成
 
Rとデータベース 第61回 Tokyo.R
Rとデータベース 第61回 Tokyo.RRとデータベース 第61回 Tokyo.R
Rとデータベース 第61回 Tokyo.R
 
Tokyo r50 beginner_2
Tokyo r50 beginner_2Tokyo r50 beginner_2
Tokyo r50 beginner_2
 
Tokyo r49 beginner
Tokyo r49 beginnerTokyo r49 beginner
Tokyo r49 beginner
 
Tokyo r47 beginner
Tokyo r47 beginnerTokyo r47 beginner
Tokyo r47 beginner
 
Tokyo r47 beginner_2
Tokyo r47 beginner_2Tokyo r47 beginner_2
Tokyo r47 beginner_2
 
Tokyo r45 beginner_2
Tokyo r45 beginner_2Tokyo r45 beginner_2
Tokyo r45 beginner_2
 
Tokyo r39 beginner
Tokyo r39 beginnerTokyo r39 beginner
Tokyo r39 beginner
 
Tokyo r38
Tokyo r38Tokyo r38
Tokyo r38
 
Tokyo r30 anova_part2
Tokyo r30 anova_part2Tokyo r30 anova_part2
Tokyo r30 anova_part2
 
Tokyo r30 anova
Tokyo r30 anovaTokyo r30 anova
Tokyo r30 anova
 
Tokyo r30 beginner
Tokyo r30 beginnerTokyo r30 beginner
Tokyo r30 beginner
 
Tokyo r sqldf
Tokyo r sqldfTokyo r sqldf
Tokyo r sqldf
 
ggplot2 110129
ggplot2 110129ggplot2 110129
ggplot2 110129
 
Japan r 101127
Japan r 101127Japan r 101127
Japan r 101127
 
Tokyo r r_excel
Tokyo r r_excelTokyo r r_excel
Tokyo r r_excel
 
Tokyo r no8_海外サイトの紹介
Tokyo r no8_海外サイトの紹介Tokyo r no8_海外サイトの紹介
Tokyo r no8_海外サイトの紹介
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 

Tokyo r18

  • 2. 1.  2.  3.  R i.  ii.  iii.  demo()) iv.  v.  vi.  vii.  fucntion) viii.  4.  5.  Mac Windows
  • 3. •  : •  Twitter :aad34210 •  :http://pracmper.blogspot.com/ •  : •  : •  : Web
  • 5.
  • 7. •  •  … TokyoR Amazon (¥3,990)
  • 8. R - •  R http://www.r-project.org/
  • 9. R - •  ������ R
  • 10. R - •  … R ������ command + enter
  • 11. R - quit() R R •  R •  R
  • 12. R - •  iris •  R demo() demo(graphics)
  • 13. R - •  Retern
  • 14. R - •  •  “Iris” iris head(iris , 10) tail(iris , 10)
  • 15. R - •  •  Iris$Sepal.Length Iris[,1] | iris[1,1] head(iris[,1] , 10) Iris[ , ] Iris
  • 16. R – •  •  R •  apply apply , , •  apply(iris[1:4] , 2 , sum)   •  apply(iris[1:4] , 2 , mean)   •  apply(iris[1:4] , 2 , sd)   •  apply(iris[1:4] , 2 ,quantile)  
  • 17. R – •  •  R •  apply apply , , •  apply(iris[1:4] , 2 , sum)   •  apply(iris[1:4] , 2 , mean)   •  apply(iris[1:4] , 2 , sd)   •  apply(iris[1:4] , 2 ,quantile)  
  • 18. R – •  •  tapply() tapply , , •  tapply(iris[,1] , iris[,5] , sum)   •  tapply(iris[,1] , iris[,5] , mean)   •  tapply(iris[,1] , iris[,5] , sd)   •  tapply(iris[,1] , iris[,5] , quantile)  
  • 19. R – •  aggregate() •  aggregate( , , ) •  aggregate(iris[,1:4] , list(name = iris$Species) , sum)   •  aggregate(iris[,1:4] , list(name = iris$Species) , mean)   •  aggregate(iris[,1:4] , list(name = iris$Species) , sd)   •  aggregate(iris[,1:4] , list(name = iris$Species) , quantile)  
  • 20. R – •  •  ggplot2 ”plyr” SQL ”sqldf” ■ ggplot2 ■ sqldf ddply(full_list, sqldf SELECT c("Subject","Class"), Species , function(df) COUNT(*) as num return(c(AVERAGE=mean(df FROM $RT)))) iris GROUP BY Species ■ ■   http://cran.r-project.org/web/   http://code.google.com/p/sqldf/ packages/plyr/index.html   http://www.slideshare.net/aad34210/   http://plyr.had.co.nz/ tokyo-r-sqldf   TokyoR
  • 21. R – •  sum() , mean() •  R Excel •  Sum() Sum(iris[,1]) Mean() Mean(iris[,1]) sd() Sd(iris[,1]) Var() Var(iris[,1]) Max() max(iris[,1]) Min() Min(iris[,1]) Rank() rank(iris[,1]) Cor() cor(iris[,1] , iris[, 2])
  • 22. R – •  •  http://cran.r-project.org/doc/contrib/Short-refcard.pdf ������ Math ������ R Cheet Sheet
  • 23. R – FUNCTION) •  R … •  ������ function •  judge_value <- function(v) { Judge_value z <- ifelse(v >= 0 , "+" , "-") v 0 print(z) } judge_value(v <- -10) − judge_value(v <- 10) +
  • 24. R – FUNCTION) •  … •  Function()
  • 25. R – •  R •    •  R ■ R •  •  Install.packages() •  Vignettes •  •  CRAN Task View •  http://cran.r-project.org/ web/views/ •  •  http://cran.r- •  Twitter Facebook project.org/web/ •  Yahoo! packages/zoo/ index.html
  • 26. R – •  Install.packages() •  ggplot2 •  install.packages("ggplot2”) •  •  Library(ggplot2)
  • 27. •  R •  R •  •  •  • 
  • 28. •  1.  CRAN R DL 2.  demo() 3.  iris , iris$Sepal.length , iris[1,1] , head(iris , 10) 4.  apply , aggregate , plyr , sqldf 5.  sum() , mean() , sd() … 6.  function() 7.  install.packages()