introduction to r bddsil meetup
TRANSCRIPT
![Page 1: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/1.jpg)
INTRODUCTION TO RNimrod Priell, October 2012
Monday, February 11, 13
![Page 2: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/2.jpg)
WHAT IS R?
Monday, February 11, 13
![Page 3: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/3.jpg)
WHAT IS R?
What is C?
General-purpose programming language
How do you pick all pairs of researchers and managers in C?
Monday, February 11, 13
![Page 4: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/4.jpg)
WHAT IS R?
What is C?
General-purpose programming language
How do you pick all pairs of researchers and managers in C?
char** researchers ... /* Lior, Nimrod, Gadi */ char** managers ... /* Eran, Gadi, Roi */ int i = 0 int j = 0 for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (strncmp(researchers[i], researchers[j], 30)) { ... // expand our list, blah blah headache
Monday, February 11, 13
![Page 5: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/5.jpg)
WHAT IS R?
What is Python?
General purpose scripting language
How do you pick all pairs of researchers and managers in Python?
Monday, February 11, 13
![Page 6: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/6.jpg)
WHAT IS R?
What is Python?
General purpose scripting language
How do you pick all pairs of researchers and managers in Python?
[ (x, y) for x in [‘Gadi’,‘Nimrod’,‘Lior’] for y in [‘Gadi’, ‘Roi’, ‘Eran’] if x != y ]
Monday, February 11, 13
![Page 7: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/7.jpg)
WHAT IS R?
What is Python?
General purpose scripting language
How do you multiply matrices in Python?
Monday, February 11, 13
![Page 8: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/8.jpg)
WHAT IS R?
What is Python?
General purpose scripting language
How do you multiply matrices in Python?
def matrixmult (A, B): C = [[0 for row in range(len(A))] for col in range(len(B[0]))] for i in range(len(A)): for j in range(len(B[0])): for k in range(len(B)): C[i][j] += A[i][k]*B[k][j] return C
Monday, February 11, 13
![Page 9: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/9.jpg)
WHAT IS R?
What is Python?
General purpose scripting language
How do you multiply matrices in Python?import numpy as npx = np.arange(9).reshape((3,3))y = np.arange(3)print np.dot(x,y)x.T.dot(A.T).dot(A.inverse()).dot(x)
Monday, February 11, 13
![Page 10: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/10.jpg)
WHAT IS R?
What is Matlab?
Algebraic programming language
How do you multiply matrices in Matlab?
A = [ 1 2 3; 4 5 6; 7 8 9 ]b = [ 6 4 -1 ]A’ * b’ * b / A
Monday, February 11, 13
![Page 11: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/11.jpg)
WHAT IS R?
Incidentally, what is APL? (“A Programming Language”)
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵} (Conway's game of life in APL)
Monday, February 11, 13
![Page 12: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/12.jpg)
WHAT IS R?
Statistical programming language
Interpreted, Object Oriented, Functional
First-class data-sets, plotting and models.
cov(data$Income[data$Gender == ‘M’ & data$country %in% c(‘uk’,’us’,’il’)], data$LifeExp[data$Gender == ‘F’ & data$Age > 14])
lm(data, Income ~ Gender + Age)
predict(model, data)
Monday, February 11, 13
![Page 13: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/13.jpg)
WHY R?
Alternatives: Stata, SPSS, SAS, Excel
R is Free and Open Source
Packages for time-series, machinelearning, biological simulation,computer vision, GPS, MapReduce,animation, optimization, graphanalysis, reading any kind of dataformat, weather prediction, ...
academia contributing packages
http://cran.r-project.org/web/packages/
Monday, February 11, 13
![Page 14: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/14.jpg)
WHY R?
R has Reproducible Research
Excel: Click death
Demo #1
Monday, February 11, 13
![Page 15: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/15.jpg)
WHY R?
R is a general purpose programming language
Monday, February 11, 13
![Page 16: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/16.jpg)
WHY R?
R is a general purpose programming language
Monday, February 11, 13
![Page 17: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/17.jpg)
WHY R?
R is a general purpose programming language
Monday, February 11, 13
![Page 18: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/18.jpg)
WHY R?
R is a general purpose programming language
Other alternatives are very specific: Weka, Orange, etc.
Monday, February 11, 13
![Page 19: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/19.jpg)
R DEMO
The DataFrame
IO
Statistics & Models
Plotting
Remote RStudio
https://gist.github.com/2838511
Monday, February 11, 13
![Page 20: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/20.jpg)
WHY NOT R?
Terribly slow...
... But there’s RCPP, RHadoop and multicore
Terrible OO support and very quirky language
... But that only bothers you if you write packages
Monday, February 11, 13
![Page 22: Introduction to r bddsil meetup](https://reader033.vdocuments.us/reader033/viewer/2022050922/55a2c2af1a28abb6018b45d8/html5/thumbnails/22.jpg)
SOME SOURCES
Tal Galili’s Blog Archivehttp://www.r-bloggers.com/
Israeli R User Grouphttp://groups.google.com/group/israel-r-user-group
RSeek Search Enginehttp://www.rseek.org/
R Mailing List Archiveshttp://tolstoy.newcastle.edu.au/R/
Monday, February 11, 13