Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
belgrade2018_satrday_oop_Ildi_Czeller.pdf
Ildikó Czeller
October 27, 2018
Programming
0
23
belgrade2018_satrday_oop_Ildi_Czeller.pdf
Ildikó Czeller
October 27, 2018
Tweet
Share
More Decks by Ildikó Czeller
See All by Ildikó Czeller
Making Email Campaigns More Effective: Send Time Optimization
czeildi
0
150
ropsec: a package for easing operations security for the R user
czeildi
2
260
The essentials to work with object-oriented systems in R
czeildi
0
27
Making email campaigns more effective: Send time optimization
czeildi
0
110
Other Decks in Programming
See All in Programming
Edge Side Frontend という新領域
mizchi
22
10k
VIMRC 2022
achimnol
0
130
料理の注文メニューの3D化への挑戦
hideg
0
280
kintone × LINE Bot で餃子検定Botを作った話
naberina
0
330
Efficient UI testing in Android
alexzhukovich
1
120
Reactは何を提供するLibraryなのか?
taro28
6
920
読みやすいコード クラスメソッド 2022 年度新卒研修
januswel
0
2.9k
SRE NEXT 2022に学ぶこれからのSREキャリア
fukubaka0825
2
390
Rに管理されてみる
kazutan
0
250
Amazon Lookout for Visionで 筆跡鑑定してみた
cmnakamurashogo
0
160
パラメタライズドテスト
ledsun
0
220
ちょっとつよい足トラ
logilabo
0
380
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
261
37k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
316
19k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
52k
Embracing the Ebb and Flow
colly
73
3.4k
The Brand Is Dead. Long Live the Brand.
mthomps
46
2.7k
Creatively Recalculating Your Daily Design Routine
revolveconf
207
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
18
40k
Code Reviewing Like a Champion
maltzj
506
37k
VelocityConf: Rendering Performance Case Studies
addyosmani
316
22k
Put a Button on it: Removing Barriers to Going Fast.
kastner
56
2.3k
Faster Mobile Websites
deanohume
294
28k
Transcript
object-oriented systems in R Ildi Czeller : @czeildi
- Data Scientist @Emarsys - 3 years R - started
with C++, Python Me:
- R user without CS background - understand core concepts
- explore & debug more effectively You:
summary(lm(y~x)) ... Coefficients: ... Signif codes: 0 ‘***’ Multiple R-squared:
0.7262 Min. : 1.0 1st Qu.: 25.8 Median : 50.5 Mean : 10049.5 3rd Qu.: 75.2 Max. :1000000.0 summary(c(1:99, 10^6))
date: 2018-10-27 venue: Belgrade # participants: 100+ attend -> learn
talk at -> feedback organize -> proud data behavior + object =
S3
+36 1 333-3333
lm(y~x) summary summary.lm Coef R^2
lm(y~x) summary summary.lm dispatch method class + generic +
details
class / object type
type/class in R integer character list Date data.frame r_conference base
types S3 types
method summary.lm generic class as.factor
method summary.data.frame generic class as.Date.numeric class generic
generic summary <- function(object, …) UseMethod(“summary”) sum <- function(…, na.rm
= FALSE) .Primitive(“sum”)
summary(lm(y~x)) Coefficients: … Signif codes: 0 ‘***’ Multiple R-squared: 0.7262
summary.lm(lm(y~x)) dispatch
why so powerful?
flexible & extensible
base R + different packages work together
complex types can inherit behavior from simpler types
class is a vector c(”r_conference”, “conference”, “event”) most specific à
à à least specific
specialize • print(data.table()) • print.data.table(data.table()) Sepal.Length Sepal.Width 1: 5.1 3.5
2: 4.9 3.0 3: 4.7 3.2 4: 4.6 3.1 5: 5.0 3.6 --- 146: 6.7 3.0 147: 6.3 2.5 148: 6.5 3.0 149: 6.2 3.4 150: 5.9 3.0 • print(data.frame()) • print.data.frame(data.frame()) Sepal.Length Sepal.Width 1 5.1 3.5 2 4.9 3.0 3 4.7 3.2 4 4.6 3.1 5 5.0 3.6 6 5.4 3.9 7 4.6 3.4 8 5.0 3.4 9 4.4 2.9 10 4.9 3.1 …
fallback • summary(data.table()) • summary.data.table(data.table()) • summary.data.frame(data.table()) Sepal.Length Min. :4.300
1st Qu.:5.100 Median :5.800 Mean :5.843 3rd Qu.:6.400 Max. :7.900 • summary(data.frame()) • summary.data.frame(data.frame()) Sepal.Length Min. :4.300 1st Qu.:5.100 Median :5.800 Mean :5.843 3rd Qu.:6.400 Max. :7.900
extend gift.conference gift.r_conference
learn more
explore • seq.Date • data.table:::print.data.table • lookup::lookup(“sum”) – Jim Hester
• https://github.com/wch/r-source
explore • sloop – R package by Hadley Wickham •
s3_class, ftype • s3_dispatch • s3_methods_class, s3_methods_generic
Advanced R by Hadley Wickham https://www.ildiczeller.com/2018/ 04/02/investigating-difftime- behavior/
take-away
use understand (create)