09.qmd (2775B)
1 --- 2 title: Cohort 9 3 --- 4 5 {{< video https://www.youtube.com/embed/6yW9dlErLv0 >}} 6 7 <details> 8 9 <summary>Meeting chat log</summary> 10 ``` 11 00:08:26 Olivier Leroy: Start 12 00:11:23 Olivier Leroy: Yeah unsure that s3 count as OOP it really def or your def of OOP 😛 13 00:12:57 Olivier Leroy: Is S still in dev. ? 14 00:14:53 Jeffrey Stevens: From Wikipedia: 15 The latest version of the S standard is S4, released in 1998.[17] It provides advanced object-oriented features. S4 classes differ markedly from S3 classes; S4 formally defines the representation and inheritance for each class, and has multiple dispatch: the generic function can be dispatched to a method based on the class of any number of arguments, not just one. 16 00:15:20 Derek Sollberger (he/him): "S7 = S3 + S4 17 00:15:28 Diana Garcia Cortes: Reacted to ""S7 = S3 + S4" with 😂 18 00:15:36 Olivier Leroy: Reacted to ""S7 = S3 + S4" with 😂 19 00:17:03 Olivier Leroy: “The S7 package is a new OOP system designed to be a successor to S3 and S4” (https://rconsortium.github.io/S7/) 20 00:21:05 Jeffrey Stevens: "S-PLUS 7.0 released in 2005" (https://en.wikipedia.org/wiki/S-PLUS) 21 00:22:04 Diana Garcia Cortes: I guess we got an example of encapsulation last week when we used ::: to access some internal method (although I don’t recall why we did that) 22 00:22:34 Olivier Leroy: Inheritance is weird in s3, example an object that is tibble, data.frame, list. It dispatch to tibble class then data.frame 23 00:22:38 Olivier Leroy: Reacted to "I guess we got an ex..." with 👍 24 00:24:51 Diana Garcia Cortes: Reacted to "Inheritance is weird..." with 👍 25 00:27:08 Olivier Leroy: The sf packages use s3 a lot 26 00:29:33 Olivier Leroy: Example of R6 (I think) https://gargle.r-lib.org/ example: https://gargle.r-lib.org/reference/Gargle-class.html 27 00:39:22 Olivier Leroy: One stuff that bother me with s3 class definition is that I do not think they are clear organizational rules on were the class definition should be put in a package (I will maybe proved wrong soon) 28 00:40:24 Diana Garcia Cortes: Reacted to "One stuff that bothe..." with 😯 29 00:41:42 Olivier Leroy: typeof(as.raw(0x0f)) also ... 30 00:46:55 Olivier Leroy: > ‘as.numeric’ is a generic function, but S3 methods must be written 31 for ‘as.double’. It is identical to ‘as.double’. 32 00:46:59 Olivier Leroy: From the doc 😛 33 00:49:09 Olivier Leroy: Isn’t it because is.nuneric on class factor is diffrent? 34 00:50:34 Jeffrey Stevens: Why does is.integer(typeof(factor("x"))) show up as false? 35 00:51:06 Olivier Leroy: "Integer” 36 00:51:20 Diana Garcia Cortes: typeof(...) 37 00:51:36 Diana Garcia Cortes: > typeof(...) 38 Error: '...' used in an incorrect context 39 > typeof(`...`) 40 Error: '...' used in an incorrect context 41 00:52:56 Olivier Leroy: End 42 ``` 43 </details>