SlideShare a Scribd company logo
1 of 29
Download to read offline
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

More Related Content

Viewers also liked

Rで解く最適化問題 線型計画問題編
Rで解く最適化問題   線型計画問題編 Rで解く最適化問題   線型計画問題編
Rで解く最適化問題 線型計画問題編 Hidekazu Tanaka
 
3次元のデータをグラフにする(Tokyo.R#17)
3次元のデータをグラフにする(Tokyo.R#17)3次元のデータをグラフにする(Tokyo.R#17)
3次元のデータをグラフにする(Tokyo.R#17)Takumi Tsutaya
 
Rデバッグあれこれ
RデバッグあれこれRデバッグあれこれ
RデバッグあれこれTakeshi Arabiki
 
R6パッケージの紹介―機能と実装
R6パッケージの紹介―機能と実装R6パッケージの紹介―機能と実装
R6パッケージの紹介―機能と実装__nakamichi__
 
近似ベイズ計算によるベイズ推定
近似ベイズ計算によるベイズ推定近似ベイズ計算によるベイズ推定
近似ベイズ計算によるベイズ推定Kosei ABE
 
Tokyo webmining 複雑ネットワークとデータマイニング
Tokyo webmining 複雑ネットワークとデータマイニングTokyo webmining 複雑ネットワークとデータマイニング
Tokyo webmining 複雑ネットワークとデータマイニングHiroko Onari
 
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18
Rで学ぶ現代ポートフォリオ理論入門 - TokyoR #18horihorio
 
Tokyo r24 r_graph_tutorial
Tokyo r24 r_graph_tutorialTokyo r24 r_graph_tutorial
Tokyo r24 r_graph_tutorialTakashi Minoda
 
[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~こだわりの理由と実現方法とは~」 ...Insight Technology, Inc.
 
ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発
ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発
ROS の活用による屋外の歩行者空間に適応した自律移動ロボットの開発Yoshitaka HARA
 
パターン認識 08 09 k-近傍法 lvq
パターン認識 08 09 k-近傍法 lvqパターン認識 08 09 k-近傍法 lvq
パターン認識 08 09 k-近傍法 lvqsleipnir002
 
R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜
R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜
R言語で始めよう、データサイエンス(ハンズオン勉強会) 〜機会学習・データビジュアライゼーション事始め〜Yasuyuki Sugai
 

Viewers also liked (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
 

Similar to TokyoR #18 Introduction to R Functions and Packages

楽々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 Introductionelliando dias
 
Great BigTable and my toys
Great BigTable and my toysGreat BigTable and my toys
Great BigTable and my toysmseki
 
Using Raspberry Pi GPU for DNN
Using Raspberry Pi GPU for DNNUsing Raspberry Pi GPU for DNN
Using Raspberry Pi GPU for DNNnotogawa
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Ram Narasimhan
 
R v01 rprogamming_basic01 (R 프로그래밍 기본)
R v01 rprogamming_basic01 (R 프로그래밍 기본)R v01 rprogamming_basic01 (R 프로그래밍 기본)
R v01 rprogamming_basic01 (R 프로그래밍 기본)BuskersBu
 
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 ...Databricks
 
Datamining R 4th
Datamining R 4thDatamining R 4th
Datamining R 4thsesejun
 
R - Basic Introduction
R - Basic IntroductionR - Basic Introduction
R - Basic IntroductionKU by ADDI
 
Extend R with C!!!
Extend R with C!!!Extend R with C!!!
Extend R with C!!!mickey24
 
R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for BeginnersMetamarkets
 
Introduction to R
Introduction to RIntroduction to R
Introduction to RHappy Garg
 
Geoff Rothman Presentation on Parallel Processing
Geoff Rothman Presentation on Parallel ProcessingGeoff Rothman Presentation on Parallel Processing
Geoff Rothman Presentation on Parallel ProcessingGeoff Rothman
 
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;dankogai
 
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, midpointLori Rapp
 

Similar to TokyoR #18 Introduction to R Functions and Packages (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
 

More from Takashi Minoda

Introduction r (R入門)
Introduction r (R入門)Introduction r (R入門)
Introduction r (R入門)Takashi Minoda
 
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)Takashi Minoda
 
RからGoogle Cloud Vision API を利用する
RからGoogle Cloud Vision API を利用するRからGoogle Cloud Vision API を利用する
RからGoogle Cloud Vision API を利用するTakashi Minoda
 
TokyoR:RMarkdownでレポート作成
TokyoR:RMarkdownでレポート作成TokyoR:RMarkdownでレポート作成
TokyoR:RMarkdownでレポート作成Takashi Minoda
 
Rとデータベース 第61回 Tokyo.R
Rとデータベース 第61回 Tokyo.RRとデータベース 第61回 Tokyo.R
Rとデータベース 第61回 Tokyo.RTakashi Minoda
 
Tokyo r no8_海外サイトの紹介
Tokyo r no8_海外サイトの紹介Tokyo r no8_海外サイトの紹介
Tokyo r no8_海外サイトの紹介Takashi Minoda
 

More from 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_海外サイトの紹介
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

TokyoR #18 Introduction to R Functions and Packages

  • 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()