Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
belgrade2018_satrday_oop_Ildi_Czeller.pdf
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ildikó Czeller
October 27, 2018
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
belgrade2018_satrday_oop_Ildi_Czeller.pdf
Ildikó Czeller
October 27, 2018
More Decks by Ildikó Czeller
See All by Ildikó Czeller
Making Email Campaigns More Effective: Send Time Optimization
czeildi
0
360
ropsec: a package for easing operations security for the R user
czeildi
2
650
The essentials to work with object-oriented systems in R
czeildi
0
120
Making email campaigns more effective: Send time optimization
czeildi
0
110
Other Decks in Programming
See All in Programming
OSもどきOS
arkw
0
590
Creating Composable Callables in Contemporary C++
rollbear
0
160
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
170
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
740
Vite+ Unified Toolchain for the Web
naokihaba
0
340
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
740
AIで効率化できた業務・日常
ochtum
0
140
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
570
New "Type" system on PicoRuby
pocke
1
1k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
280
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
310
Leo the Paperboy
mayatellez
7
1.9k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
860
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
850
Test your architecture with Archunit
thirion
1
2.3k
Building Applications with DynamoDB
mza
96
7.1k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
310
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Faster Mobile Websites
deanohume
310
32k
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)