SlideShare una empresa de Scribd logo
1 de 40
R Language
ian
Why ?
Background of R
What is R?
GNU Project Developed by John Chambers @ Bell Lab
Free software environment for statistical computing and graphics
Functional programming language written primarily in C, Fortran
 R is functional programming language
 R is an interpreted language
 R is object oriented-language
R Language
 Statistic analysis on the fly
 Mathematical function and graphic module
embedded
 FREE! & Open Source!
 http://cran.r-project.org/src/base/
Why Using R
What is your programming language of choice, R, Python or
something else?
“I use R, and occasionally matlab, for data analysis. There is a
large, active and extremely knowledgeable R community at
Google.”
http://simplystatistics.org/2013/02/15/interview-with-nick-chamandy-statistician-at-google/
Data Scientist of these Companies
Using R
“Expert knowledge of SAS (With Enterprise
Guide/Miner) required and candidates with strong
knowledge of R will be preferred”
http://www.kdnuggets.com/jobs/13/03-29-apple-sr-data-
scientist.html?utm_source=twitterfeed&utm_medium=facebook&utm_campaign=tfb&utm
_content=FaceBook&utm_term=analytics#.UVXibgXOpfc.facebook
 In 2007, Revolution Analytics providea commercial support for
Revolution R
 http://www.revolutionanalytics.com/products/revolution-r.php
 http://www.revolutionanalytics.com/why-revolution-r/which-r-is-right-for-me.php
 Big Data Appliance, which integrates R, Apache Hadoop, Oracle
Enterprise Linux, and a NoSQL database with the
Exadata hardware
 http://www.oracle.com/us/products/database/big-data-
appliance/overview/index.html
Commercial support for R
 Free for Community Version
 http://www.revolutionanalytics.com/downloads/
 http://www.revolutionanalytics.com/why-revolution-r/benchmarks.php
Revolotion R
Base R 2.14.2 64
Revolution R (1-
core)
Revolution R (4-
core)
Speedup (4 core)
Matrix
Calculation
17.4 sec 2.9 sec 2.0 sec 7.9x
Matrix Functions 10.3 sec 2.0 sec 1.2 sec 7.8x
Program Control 2.7 sec 2.7 sec 2.7 sec Not Appreciable
R Studio
 http://www.rstudio.com/
IDE
RGUI
•http://www.r-project.org/
Shiny makes it super simple for R users like you to turn
analyses into interactive web applications that anyone can
use
http://www.rstudio.com/shiny/
Web App Development
 CRAN (Comprehensive R Archive Network)
Package Management
Repository URL
CRAN http://cran.r-project.org/web/packages/
Bioconductor http://www.bioconductor.org/packages/release/Software.html
R-Forge http://r-forge.r-project.org/
R Basic
 help()
 help(demo)
 demo()
 demo(is.things)
 q()
 ls()
 rm()
 rm(x)
Basic Command
 Vector
 List
 Factor
 Array
 Matrix
 Data Frame
Basic Object
 物件類型(type)主要是向量(vector),矩陣(matrix),陣列(array),因
素(factor),列表(list),資料框架(data frame),函式(function).
 物件基本元素之“模式” (basic mode)分成
 1."numeric",實數型,含"integer",整數型(有時需特別指定),與
"double",倍精確度型.
 2."logical",邏輯型(true or false),以TRUE(T)或FALSE(F)呈現, (也
可以是1 (T)與0 (F).
 3."complex",複數型
 4."character",文字型(或字串),通常輸入時,在文字或字串兩側加
上雙引號(").
 Scalar
 x=3; y<-5; x+y
 Vectors
 x = c(1,2,3, 7); y= c(2,3,5,1); x+y; x*y; x – y; x/y;
 x =seq(1,10); y= 2:11; x+y
 x =seq(1,10,by=2); y =seq(1,10,length=2)
 rep(c(5,8), 3)
 x= c(1,2,3); length(x)
Objects & Arithmetic
 Summary
 X = c(1,2,3,4,5,6,7,8,9,10)
 mean(x), min(x), median(x), max(x), var(x)
 summary(x)
 Subscripting
 x = c(1,2,3,4,5,6,7,8,9,10)
 x[1:3]; x[c(1,3,5)];
 x[c(1,3,5)] * 2 + x[c(2,2,2)]
 x[-(1:6)]
Summaries and Subscripting
 Contain a heterogeneous selection of objects
 e <- list(thing="hat", size="8.25"); e
 l <- list(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10)
 l$j
 man = list(name="Qoo", height=183); man$name
Lists
 Ordered collection of items to present categorical
value
 Different values that the factor can take are called
levels
 Factors
 phone = factor(c('iphone', 'htc', 'iphone', 'samsung',
'iphone', 'samsung'))
 levels(phone)
Factor
 Array
 An extension of a vector to more than two dimensions
 a <- array(c(1,2,3,4,5,6,7,8,9,10,11,12),dim=c(3,4))
 Matrices
 A vector to two dimensions – 2d-array
 x = c(1,2,3); y = c(4,5,6); rbind(x,y);cbind(x,y)
 x = rbind(c(1,2,3),c(4,5,6)); dim(x)
 x<-matrix(c(1,2,3,4,5,6),nr=3);
 x<-matrix(c(1,2,3,4,5,6),nrow=3, ,byrow=T)
 x<-matrix(c(1,2,3,4),nr=2);y<-matrix(c(5,6),nr=2); x%*%y
 t(matrix(c(1,2,3,4),nr=2))
 solve(matrix(c(1,2,3,4),nr=2))
Matrices & Array
 Useful way to represent tabular data
 essentially a matrix with named columns may also
include non-numerical variables
 Example
 df = data.frame(a=c(1,2,3,4,5),b=c(2,3,4,5,6));df
Data Frame
 Function
 `%myop%` <- function(a, b) {2*a + 2*b}; 1 %myop% 1
 f <- function(x) {return(x^2 + 3)}
 create.vector.of.ones <- function(n) {
return.vector <- NA;
for (i in 1:n) {
return.vector[i] <- 1;
} return.vector;
}
 create.vector.of.ones(3)
 Control Structures
 If …else…
 Repeat, for, while
 Catch error – trycatch
Function
 Functional language Characteristic
 apply.to.three <- function(f) {f(3)}
 apply.to.three(function(x) {x * 7})
Anonymous Function
 All R code manipulates objects.
 Every object in R has a type
 In assignment statements, R will copy the object, not
just the reference to the object Attributes
Objects and Classes
 Many R functions were implemented using S3
methods
 In S version 4 (hence S4), formal classes and methods
were introduced that allowed
 Multiple arguments
 Abstract types
 inheritance.
S3 & S4 Object
 S4 OOP Example
 setClass("Student", representation(name = "character",
score="numeric"))
 studenta = new ("Student", name="david", score=80 )
 studentb = new ("Student", name="andy", score=90 )
setMethod("show", signature("Student"),
function(object) {
cat(object@score+100)
})
 setGeneric("getscore", function(object)
standardGeneric("getscore"))
 Studenta
OOP of S4
 A package is a related set of functions, help files, and
data files that have been bundled together.
 Basic Command
 library(rpart)
 CRAN
 Install
 (.packages())
Packages
29
Package used in Machine Learning
for Hackers
 Apply
 Returns a vector or array or list of values obtained by
applying a function to margins of an array or matrix.
 data <- cbind(c(1,2),c(3,4))
 data.rowsum <- apply(data,1,sum)
 data.colsum <- apply(data,2,sum)
 data
Apply
 Save and Load
 x = USPersonalExpenditure
 save(x, file="~/test.RData")
 rm(x)
 load("~/test.RData")
 x
File IO
Charts and Graphics
 xrange = range(as.numeric(colnames(USPersonalExpenditure)));
 yrange= range(USPersonalExpenditure);
 plot(xrange, yrange, type="n", xlab="Year",ylab="Category" )
 for(i in 1:5) {
lines(as.numeric(colnames(USPersonalExpenditure)),USPersonalExpendi
ture[i,], type="b", lwd=1.5)
}
Plotting Example
Reference & Resource
 R in a nutshell
Study Material
Online Reference
37
Community Resources for R help
 Websites
 Stackoverflow
 Cross Validated
 R-help
 R-devel
 R-sig-*
 Package-specific mailing list
 Blog
 R-bloggers
 Twitter
 https://twitter.com/#rstats
 Quora
 http://www.quora.com/R-software
Resource
 Conference
 useR!
 R in Finance
 R in Insurance
 Others
 Joint Statistical Meetings
 Royal Statistical Society Conference
 Local User Group
 http://blog.revolutionanalytics.com/local-r-groups.html
 Taiwan R User Group
 http://www.facebook.com/Tw.R.User
 http://www.meetup.com/Taiwan-R/
Resource (Con’d)
Thank You!
11/20/2015 40Confidential | Copyright 2012 Trend Micro Inc.

Más contenido relacionado

La actualidad más candente

Introduction To R Language
Introduction To R LanguageIntroduction To R Language
Introduction To R LanguageGaurang Dobariya
 
R basics
R basicsR basics
R basicsFAO
 
R tutorial for a windows environment
R tutorial for a windows environmentR tutorial for a windows environment
R tutorial for a windows environmentYogendra Chaubey
 
R Programming Tutorial for Beginners - -TIB Academy
R Programming Tutorial for Beginners - -TIB AcademyR Programming Tutorial for Beginners - -TIB Academy
R Programming Tutorial for Beginners - -TIB Academyrajkamaltibacademy
 
R Programming Language
R Programming LanguageR Programming Language
R Programming LanguageNareshKarela1
 
Introduction to the language R
Introduction to the language RIntroduction to the language R
Introduction to the language Rfbenault
 
2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factorskrishna singh
 
Best corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiBest corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiUnmesh Baile
 
R programming groundup-basic-section-i
R programming groundup-basic-section-iR programming groundup-basic-section-i
R programming groundup-basic-section-iDr. Awase Khirni Syed
 
R programming Fundamentals
R programming  FundamentalsR programming  Fundamentals
R programming FundamentalsRagia Ibrahim
 
R Programming: Importing Data In R
R Programming: Importing Data In RR Programming: Importing Data In R
R Programming: Importing Data In RRsquared Academy
 
Functional Programming in R
Functional Programming in RFunctional Programming in R
Functional Programming in RSoumendra Dhanee
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with RShareThis
 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classificationYanchang Zhao
 

La actualidad más candente (20)

Introduction To R Language
Introduction To R LanguageIntroduction To R Language
Introduction To R Language
 
R programming language
R programming languageR programming language
R programming language
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
R programming by ganesh kavhar
R programming by ganesh kavharR programming by ganesh kavhar
R programming by ganesh kavhar
 
R basics
R basicsR basics
R basics
 
R tutorial for a windows environment
R tutorial for a windows environmentR tutorial for a windows environment
R tutorial for a windows environment
 
R language introduction
R language introductionR language introduction
R language introduction
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
R Programming Tutorial for Beginners - -TIB Academy
R Programming Tutorial for Beginners - -TIB AcademyR Programming Tutorial for Beginners - -TIB Academy
R Programming Tutorial for Beginners - -TIB Academy
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
 
Introduction to the language R
Introduction to the language RIntroduction to the language R
Introduction to the language R
 
2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors
 
Best corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiBest corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbai
 
Machine Learning in R
Machine Learning in RMachine Learning in R
Machine Learning in R
 
R programming groundup-basic-section-i
R programming groundup-basic-section-iR programming groundup-basic-section-i
R programming groundup-basic-section-i
 
R programming Fundamentals
R programming  FundamentalsR programming  Fundamentals
R programming Fundamentals
 
R Programming: Importing Data In R
R Programming: Importing Data In RR Programming: Importing Data In R
R Programming: Importing Data In R
 
Functional Programming in R
Functional Programming in RFunctional Programming in R
Functional Programming in R
 
Data analysis with R
Data analysis with RData analysis with R
Data analysis with R
 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classification
 

Destacado

Learning R and Teaching R
Learning R and Teaching RLearning R and Teaching R
Learning R and Teaching RAjay Ohri
 
Industrial internet big data uk market study
Industrial internet big data uk market studyIndustrial internet big data uk market study
Industrial internet big data uk market studySari Ojala
 
Competition Improves Performance: Only when Competition Form matches Goal Ori...
Competition Improves Performance: Only when Competition Form matches Goal Ori...Competition Improves Performance: Only when Competition Form matches Goal Ori...
Competition Improves Performance: Only when Competition Form matches Goal Ori...Eugene Yan Ziyou
 
Social network analysis and growth recommendations for DataScience SG community
Social network analysis and growth recommendations for DataScience SG communitySocial network analysis and growth recommendations for DataScience SG community
Social network analysis and growth recommendations for DataScience SG communityEugene Yan Ziyou
 
R language Project report
R language Project reportR language Project report
R language Project reportTianyue Wang
 
AXA x DSSG Meetup Sharing (Feb 2016)
AXA x DSSG Meetup Sharing (Feb 2016)AXA x DSSG Meetup Sharing (Feb 2016)
AXA x DSSG Meetup Sharing (Feb 2016)Eugene Yan Ziyou
 
Introduction to basic statistics
Introduction to basic statisticsIntroduction to basic statistics
Introduction to basic statisticsIBM
 
Big Data Paris - A Modern Enterprise Architecture
Big Data Paris - A Modern Enterprise ArchitectureBig Data Paris - A Modern Enterprise Architecture
Big Data Paris - A Modern Enterprise ArchitectureMongoDB
 
Xavier Conort, DataScience SG Meetup - Challenges in insurance pricing
Xavier Conort, DataScience SG Meetup - Challenges in insurance pricingXavier Conort, DataScience SG Meetup - Challenges in insurance pricing
Xavier Conort, DataScience SG Meetup - Challenges in insurance pricingKai Xin Thia
 
Kudu: New Hadoop Storage for Fast Analytics on Fast Data
Kudu: New Hadoop Storage for Fast Analytics on Fast DataKudu: New Hadoop Storage for Fast Analytics on Fast Data
Kudu: New Hadoop Storage for Fast Analytics on Fast DataCloudera, Inc.
 
How Lazada ranks products to improve customer experience and conversion
How Lazada ranks products to improve customer experience and conversionHow Lazada ranks products to improve customer experience and conversion
How Lazada ranks products to improve customer experience and conversionEugene Yan Ziyou
 
지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기Ted Won
 

Destacado (15)

Ppt
PptPpt
Ppt
 
Learning R and Teaching R
Learning R and Teaching RLearning R and Teaching R
Learning R and Teaching R
 
Industrial internet big data uk market study
Industrial internet big data uk market studyIndustrial internet big data uk market study
Industrial internet big data uk market study
 
Competition Improves Performance: Only when Competition Form matches Goal Ori...
Competition Improves Performance: Only when Competition Form matches Goal Ori...Competition Improves Performance: Only when Competition Form matches Goal Ori...
Competition Improves Performance: Only when Competition Form matches Goal Ori...
 
Social network analysis and growth recommendations for DataScience SG community
Social network analysis and growth recommendations for DataScience SG communitySocial network analysis and growth recommendations for DataScience SG community
Social network analysis and growth recommendations for DataScience SG community
 
R language Project report
R language Project reportR language Project report
R language Project report
 
AXA x DSSG Meetup Sharing (Feb 2016)
AXA x DSSG Meetup Sharing (Feb 2016)AXA x DSSG Meetup Sharing (Feb 2016)
AXA x DSSG Meetup Sharing (Feb 2016)
 
Introduction to basic statistics
Introduction to basic statisticsIntroduction to basic statistics
Introduction to basic statistics
 
Datalake Architecture
Datalake ArchitectureDatalake Architecture
Datalake Architecture
 
Big Data Paris - A Modern Enterprise Architecture
Big Data Paris - A Modern Enterprise ArchitectureBig Data Paris - A Modern Enterprise Architecture
Big Data Paris - A Modern Enterprise Architecture
 
Xavier Conort, DataScience SG Meetup - Challenges in insurance pricing
Xavier Conort, DataScience SG Meetup - Challenges in insurance pricingXavier Conort, DataScience SG Meetup - Challenges in insurance pricing
Xavier Conort, DataScience SG Meetup - Challenges in insurance pricing
 
Kudu: New Hadoop Storage for Fast Analytics on Fast Data
Kudu: New Hadoop Storage for Fast Analytics on Fast DataKudu: New Hadoop Storage for Fast Analytics on Fast Data
Kudu: New Hadoop Storage for Fast Analytics on Fast Data
 
How Lazada ranks products to improve customer experience and conversion
How Lazada ranks products to improve customer experience and conversionHow Lazada ranks products to improve customer experience and conversion
How Lazada ranks products to improve customer experience and conversion
 
지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기지금 핫한 Real-time In-memory Stream Processing 이야기
지금 핫한 Real-time In-memory Stream Processing 이야기
 
Big data ppt
Big  data pptBig  data ppt
Big data ppt
 

Similar a R language

Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonRalf Gommers
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptxranapoonam1
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxrajalakshmi5921
 
Introduction to R
Introduction to RIntroduction to R
Introduction to Ragnonchik
 
Introduction to Python , Overview
Introduction to Python , OverviewIntroduction to Python , Overview
Introduction to Python , OverviewNB Veeresh
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Martin Odersky
 
Native interfaces for R
Native interfaces for RNative interfaces for R
Native interfaces for RSeth Falcon
 
Introduction to SparkR
Introduction to SparkRIntroduction to SparkR
Introduction to SparkRKien Dang
 
Poetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePoetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePeter Solymos
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packagesAjay Ohri
 
200612_BioPackathon_ss
200612_BioPackathon_ss200612_BioPackathon_ss
200612_BioPackathon_ssSatoshi Kume
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R langsenthil0809
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdfRohanBorgalli
 
javascript
javascript javascript
javascript Kaya Ota
 
Data analysis in R
Data analysis in RData analysis in R
Data analysis in RAndrew Lowe
 

Similar a R language (20)

Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for Python
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
 
Easy R
Easy REasy R
Easy R
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
 
R basics for MBA Students[1].pptx
R basics for MBA Students[1].pptxR basics for MBA Students[1].pptx
R basics for MBA Students[1].pptx
 
Unit 3
Unit 3Unit 3
Unit 3
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Introduction to Python , Overview
Introduction to Python , OverviewIntroduction to Python , Overview
Introduction to Python , Overview
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 
Native interfaces for R
Native interfaces for RNative interfaces for R
Native interfaces for R
 
Introduction to SparkR
Introduction to SparkRIntroduction to SparkR
Introduction to SparkR
 
Poetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePoetry with R -- Dissecting the code
Poetry with R -- Dissecting the code
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
Dynamic Python
Dynamic PythonDynamic Python
Dynamic Python
 
200612_BioPackathon_ss
200612_BioPackathon_ss200612_BioPackathon_ss
200612_BioPackathon_ss
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
 
javascript
javascript javascript
javascript
 
Data analysis in R
Data analysis in RData analysis in R
Data analysis in R
 

Más de LearningTech

Más de LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection &amp; activator
Reflection &amp; activatorReflection &amp; activator
Reflection &amp; activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

Último

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Último (20)

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

R language

  • 4. What is R? GNU Project Developed by John Chambers @ Bell Lab Free software environment for statistical computing and graphics Functional programming language written primarily in C, Fortran
  • 5.  R is functional programming language  R is an interpreted language  R is object oriented-language R Language
  • 6.  Statistic analysis on the fly  Mathematical function and graphic module embedded  FREE! & Open Source!  http://cran.r-project.org/src/base/ Why Using R
  • 7. What is your programming language of choice, R, Python or something else? “I use R, and occasionally matlab, for data analysis. There is a large, active and extremely knowledgeable R community at Google.” http://simplystatistics.org/2013/02/15/interview-with-nick-chamandy-statistician-at-google/ Data Scientist of these Companies Using R “Expert knowledge of SAS (With Enterprise Guide/Miner) required and candidates with strong knowledge of R will be preferred” http://www.kdnuggets.com/jobs/13/03-29-apple-sr-data- scientist.html?utm_source=twitterfeed&utm_medium=facebook&utm_campaign=tfb&utm _content=FaceBook&utm_term=analytics#.UVXibgXOpfc.facebook
  • 8.  In 2007, Revolution Analytics providea commercial support for Revolution R  http://www.revolutionanalytics.com/products/revolution-r.php  http://www.revolutionanalytics.com/why-revolution-r/which-r-is-right-for-me.php  Big Data Appliance, which integrates R, Apache Hadoop, Oracle Enterprise Linux, and a NoSQL database with the Exadata hardware  http://www.oracle.com/us/products/database/big-data- appliance/overview/index.html Commercial support for R
  • 9.  Free for Community Version  http://www.revolutionanalytics.com/downloads/  http://www.revolutionanalytics.com/why-revolution-r/benchmarks.php Revolotion R Base R 2.14.2 64 Revolution R (1- core) Revolution R (4- core) Speedup (4 core) Matrix Calculation 17.4 sec 2.9 sec 2.0 sec 7.9x Matrix Functions 10.3 sec 2.0 sec 1.2 sec 7.8x Program Control 2.7 sec 2.7 sec 2.7 sec Not Appreciable
  • 11. Shiny makes it super simple for R users like you to turn analyses into interactive web applications that anyone can use http://www.rstudio.com/shiny/ Web App Development
  • 12.  CRAN (Comprehensive R Archive Network) Package Management Repository URL CRAN http://cran.r-project.org/web/packages/ Bioconductor http://www.bioconductor.org/packages/release/Software.html R-Forge http://r-forge.r-project.org/
  • 14.  help()  help(demo)  demo()  demo(is.things)  q()  ls()  rm()  rm(x) Basic Command
  • 15.  Vector  List  Factor  Array  Matrix  Data Frame Basic Object
  • 16.  物件類型(type)主要是向量(vector),矩陣(matrix),陣列(array),因 素(factor),列表(list),資料框架(data frame),函式(function).  物件基本元素之“模式” (basic mode)分成  1."numeric",實數型,含"integer",整數型(有時需特別指定),與 "double",倍精確度型.  2."logical",邏輯型(true or false),以TRUE(T)或FALSE(F)呈現, (也 可以是1 (T)與0 (F).  3."complex",複數型  4."character",文字型(或字串),通常輸入時,在文字或字串兩側加 上雙引號(").
  • 17.  Scalar  x=3; y<-5; x+y  Vectors  x = c(1,2,3, 7); y= c(2,3,5,1); x+y; x*y; x – y; x/y;  x =seq(1,10); y= 2:11; x+y  x =seq(1,10,by=2); y =seq(1,10,length=2)  rep(c(5,8), 3)  x= c(1,2,3); length(x) Objects & Arithmetic
  • 18.  Summary  X = c(1,2,3,4,5,6,7,8,9,10)  mean(x), min(x), median(x), max(x), var(x)  summary(x)  Subscripting  x = c(1,2,3,4,5,6,7,8,9,10)  x[1:3]; x[c(1,3,5)];  x[c(1,3,5)] * 2 + x[c(2,2,2)]  x[-(1:6)] Summaries and Subscripting
  • 19.  Contain a heterogeneous selection of objects  e <- list(thing="hat", size="8.25"); e  l <- list(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10)  l$j  man = list(name="Qoo", height=183); man$name Lists
  • 20.  Ordered collection of items to present categorical value  Different values that the factor can take are called levels  Factors  phone = factor(c('iphone', 'htc', 'iphone', 'samsung', 'iphone', 'samsung'))  levels(phone) Factor
  • 21.  Array  An extension of a vector to more than two dimensions  a <- array(c(1,2,3,4,5,6,7,8,9,10,11,12),dim=c(3,4))  Matrices  A vector to two dimensions – 2d-array  x = c(1,2,3); y = c(4,5,6); rbind(x,y);cbind(x,y)  x = rbind(c(1,2,3),c(4,5,6)); dim(x)  x<-matrix(c(1,2,3,4,5,6),nr=3);  x<-matrix(c(1,2,3,4,5,6),nrow=3, ,byrow=T)  x<-matrix(c(1,2,3,4),nr=2);y<-matrix(c(5,6),nr=2); x%*%y  t(matrix(c(1,2,3,4),nr=2))  solve(matrix(c(1,2,3,4),nr=2)) Matrices & Array
  • 22.  Useful way to represent tabular data  essentially a matrix with named columns may also include non-numerical variables  Example  df = data.frame(a=c(1,2,3,4,5),b=c(2,3,4,5,6));df Data Frame
  • 23.  Function  `%myop%` <- function(a, b) {2*a + 2*b}; 1 %myop% 1  f <- function(x) {return(x^2 + 3)}  create.vector.of.ones <- function(n) { return.vector <- NA; for (i in 1:n) { return.vector[i] <- 1; } return.vector; }  create.vector.of.ones(3)  Control Structures  If …else…  Repeat, for, while  Catch error – trycatch Function
  • 24.  Functional language Characteristic  apply.to.three <- function(f) {f(3)}  apply.to.three(function(x) {x * 7}) Anonymous Function
  • 25.  All R code manipulates objects.  Every object in R has a type  In assignment statements, R will copy the object, not just the reference to the object Attributes Objects and Classes
  • 26.  Many R functions were implemented using S3 methods  In S version 4 (hence S4), formal classes and methods were introduced that allowed  Multiple arguments  Abstract types  inheritance. S3 & S4 Object
  • 27.  S4 OOP Example  setClass("Student", representation(name = "character", score="numeric"))  studenta = new ("Student", name="david", score=80 )  studentb = new ("Student", name="andy", score=90 ) setMethod("show", signature("Student"), function(object) { cat(object@score+100) })  setGeneric("getscore", function(object) standardGeneric("getscore"))  Studenta OOP of S4
  • 28.  A package is a related set of functions, help files, and data files that have been bundled together.  Basic Command  library(rpart)  CRAN  Install  (.packages()) Packages
  • 29. 29 Package used in Machine Learning for Hackers
  • 30.  Apply  Returns a vector or array or list of values obtained by applying a function to margins of an array or matrix.  data <- cbind(c(1,2),c(3,4))  data.rowsum <- apply(data,1,sum)  data.colsum <- apply(data,2,sum)  data Apply
  • 31.  Save and Load  x = USPersonalExpenditure  save(x, file="~/test.RData")  rm(x)  load("~/test.RData")  x File IO
  • 33.  xrange = range(as.numeric(colnames(USPersonalExpenditure)));  yrange= range(USPersonalExpenditure);  plot(xrange, yrange, type="n", xlab="Year",ylab="Category" )  for(i in 1:5) { lines(as.numeric(colnames(USPersonalExpenditure)),USPersonalExpendi ture[i,], type="b", lwd=1.5) } Plotting Example
  • 35.  R in a nutshell Study Material
  • 38.  Websites  Stackoverflow  Cross Validated  R-help  R-devel  R-sig-*  Package-specific mailing list  Blog  R-bloggers  Twitter  https://twitter.com/#rstats  Quora  http://www.quora.com/R-software Resource
  • 39.  Conference  useR!  R in Finance  R in Insurance  Others  Joint Statistical Meetings  Royal Statistical Society Conference  Local User Group  http://blog.revolutionanalytics.com/local-r-groups.html  Taiwan R User Group  http://www.facebook.com/Tw.R.User  http://www.meetup.com/Taiwan-R/ Resource (Con’d)
  • 40. Thank You! 11/20/2015 40Confidential | Copyright 2012 Trend Micro Inc.