commit 3bc2c44fdc76c83e2b048649c4dafa36409f1661 parent ec922a3bc83e5471d16ce73e30856613fb645986 Author: Jon Harmon <jonthegeek@gmail.com> Date: Wed, 3 Sep 2025 06:57:45 -0500 Add videos for cohorts 8-10 (#92) Diffstat:
| A | videos/01/09.qmd | | | 59 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/01/10.qmd | | | 109 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/02/08.qmd | | | 60 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/02/09.qmd | | | 46 | ++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/02/10.qmd | | | 101 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/03/08.qmd | | | 21 | +++++++++++++++++++++ | 
| A | videos/03/09.qmd | | | 73 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/03/10.qmd | | | 112 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/04/08.qmd | | | 36 | ++++++++++++++++++++++++++++++++++++ | 
| A | videos/04/09.qmd | | | 105 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/04/10.qmd | | | 35 | +++++++++++++++++++++++++++++++++++ | 
| A | videos/05/08.qmd | | | 27 | +++++++++++++++++++++++++++ | 
| A | videos/05/09.qmd | | | 176 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/06/08.qmd | | | 23 | +++++++++++++++++++++++ | 
| A | videos/06/09.qmd | | | 190 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/07/08.qmd | | | 5 | +++++ | 
| A | videos/07/09.qmd | | | 125 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/08/08.qmd | | | 19 | +++++++++++++++++++ | 
| A | videos/08/09.qmd | | | 102 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/09/08.qmd | | | 5 | +++++ | 
| A | videos/09/09.qmd | | | 120 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/10/08.qmd | | | 5 | +++++ | 
| A | videos/10/09.qmd | | | 76 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/11/08.qmd | | | 5 | +++++ | 
| A | videos/11/09.qmd | | | 19 | +++++++++++++++++++ | 
| A | videos/12/09.qmd | | | 43 | +++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/13/09.qmd | | | 63 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/14/09.qmd | | | 37 | +++++++++++++++++++++++++++++++++++++ | 
| A | videos/15/09.qmd | | | 32 | ++++++++++++++++++++++++++++++++ | 
| A | videos/16/09.qmd | | | 42 | ++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/17/09.qmd | | | 32 | ++++++++++++++++++++++++++++++++ | 
| A | videos/18/09.qmd | | | 42 | ++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/19/09.qmd | | | 40 | ++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/20/09.qmd | | | 62 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/21/09.qmd | | | 25 | +++++++++++++++++++++++++ | 
| A | videos/22/09.qmd | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ | 
| A | videos/23/09.qmd | | | 25 | +++++++++++++++++++++++++ | 
| A | videos/24/09.qmd | | | 25 | +++++++++++++++++++++++++ | 
| A | videos/25/09.qmd | | | 40 | ++++++++++++++++++++++++++++++++++++++++ | 
39 files changed, 2207 insertions(+), 0 deletions(-)
diff --git a/videos/01/09.qmd b/videos/01/09.qmd @@ -0,0 +1,59 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/OmBum_1jDjE >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:10:07 Gabby Palomo Munoz: I got my PhD at UNL!!! Go Huskers!!! +00:15:48 Jo Hardin: @Tataphani, how do *you* say your name? +00:18:37 tataphani: we can be good team me too SAS+ r +00:19:28 Olufemi Ajumobi: Reacted to "we can be good team ..." with 👍 +00:23:24 Gabby Palomo Munoz: This workflow work really well, I always use it when working on slides +00:23:53 Derek Sollberger: Aside: to these DSLC book clubs work with Quarto files? +00:24:29 Gabby Palomo Munoz: SLides are different than the book +00:24:34 Gabby Palomo Munoz: BUT they are both in bookddown +00:24:52 Gabby Palomo Munoz: SLIDES are the summarized version that each one of us create for each chapter +00:26:18 Gabby Palomo Munoz: The idea is that we don't put everything there is in the chapter in the "slides". Just important relevant things. Snipets. Jon calls them slides because ideally you should put what you are presenting on what can be shown on the screen (like a slide) and avoid scrolling +00:26:30 Derek Sollberger: Reacted to "The idea is that we ..." with 👍 +00:26:37 Gabby Palomo Munoz: BUT it's fine if your 'slide' has more info that you have to scroll through +00:27:00 Gabby Palomo Munoz: My grammar there is awful. Sorry!! +00:28:14 Gabby Palomo Munoz: I use Windows and have never had any issues with the github +00:28:18 Gabby Palomo Munoz: instructions +00:29:25 tataphani: Reacted to "I use Windows and ha..." with 👍 +00:31:57 Derek Sollberger: It feels odd being part of a book club where the slides are already there, haha +00:35:18 John Ellis: Any tips for searching for ‘R’ … ‘R Programming’? +00:35:41 Steffi LaZerte (she/her): I often include the package name or "stats" if it's related to statistics +00:35:47 John Ellis: Reacted to "I often include the ..." with 👍 +00:36:02 Jo Hardin: i usually include the word tidy +00:36:07 Derek Sollberger: Replying to "Any tips for searchi..." + +At least it is easier than searching for "pandas" +00:36:09 Diana Garcia Cortes: Reacted to "i usually include th..." with 👍 +00:36:26 Derek Sollberger: Reacted to "I often include the ..." with 👍 +00:36:27 Derek Sollberger: Reacted to "i usually include th..." with 👍 +00:36:41 Steffi LaZerte (she/her): Replying to "i usually include th..." + +Or base :D depending +00:39:21 Jo Hardin: Reacted to "Or base :D depending" with 🙂 +00:39:56 John Ellis: Reacted to "Or base :D depending" with 👍 +00:40:13 James Capobianco: First link doesn’t work for me - 404d +00:40:54 Olivier Leroy: https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/index.html +00:42:00 James Capobianco: Reacted to "https://mitp-content..." with 👍 +00:42:27 James Capobianco: Like a lot of other people said, I’m really interested in practicing functional programming. +00:42:59 Gabby Palomo Munoz: Reacted to "Like a lot of other ..." with 💯 +00:43:17 Derek Sollberger: Reacted to "Like a lot of other ..." with 💯 +00:45:23 Gabby Palomo Munoz: It's just to highlight that we need to find someone urgently for next week +00:45:35 James Capobianco: Yes, I figured it had to do with how soon that week is +00:45:47 Jo Hardin: Reacted to "It's just to highlig..." with 👍 +00:45:48 Gabby Palomo Munoz: I think Jon designed it like that to help whoever is leading the book +00:47:31 Gabby Palomo Munoz: One more thing, you don't have to know the content of the chapter and be an expert on that topic to present. +00:47:40 Derek Sollberger: Reacted to "One more thing, you ..." with 👍 +00:47:46 Gabby Palomo Munoz: Jon recommends sometimes to choose a chapter if you want to learn more about a certain topic +00:47:48 James Capobianco: Reacted to "One more thing, you ..." with 👍 +00:48:10 Gabby Palomo Munoz: And we are all here to either answer questions or redirect +``` +</details> diff --git a/videos/01/10.qmd b/videos/01/10.qmd @@ -0,0 +1,109 @@ +--- +title: Cohort 10 +--- + +{{< video https://www.youtube.com/embed/Of5Uz1psDRU >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:05:19 Olivier: Hey! (grabbing some water) +00:09:39 Jon Harmon (jonthegeek): https://DSLC.io/advr +https://docs.google.com/spreadsheets/d/1PgK1ZgOzKqIyxwS6iU_KF5LqBHrb0yx4GN0crVUAaUE/edit?usp=sharing +00:09:52 Jon Harmon (jonthegeek): start +00:11:29 Jon Harmon (jonthegeek): https://DSCL.video/advr +00:13:30 Jon Harmon (jonthegeek): https://DSLC.io/advr +https://docs.google.com/spreadsheets/d/1PgK1ZgOzKqIyxwS6iU_KF5LqBHrb0yx4GN0crVUAaUE/edit?usp=sharing +https://DSCL.video/advr +00:16:59 Olivier: chat team! +00:17:13 Eamon Caddigan: Reacted to "chat team!" with 🔥 +00:17:14 Gabby Palomo: Reacted to "chat team!" with 😂 +00:17:50 Nicholas Giangreco: What’s the GitHub link to the qmds? +00:17:56 Gabby Palomo: Replying to "chat team!" + +I just wished the emoji reactions wouldn’t translate to words when the chat is posted on Slack +00:18:35 Olivier: Reacted to "I just wished the em..." with 👾 +00:19:33 Eamon Caddigan: Replying to "What’s the GitHub li..." + +https://github.com/r4ds/bookclub-advr +00:20:22 Derek Sollberger: Reacted to "I just wished the em..." with 🌭 +00:24:52 Jon Harmon (jonthegeek): Not a recommendation: https://www.amazon.com/New-Language-Programming-Environment-Wadsworth/dp/053409192X +00:25:06 Nicholas Giangreco: Reacted to "https://github.com/r..." with 👍 +00:30:00 Ella Kaye (she/her): This is starting to sound like the 10-year R book club! +00:30:18 Gabby Palomo: Reacted to "This is starting to ..." with 😂 +00:30:24 Sally Chang: Reacted to "This is starting to ..." with 😂 +00:30:25 Derek Sollberger: Reacted to "This is starting to ..." with 1️⃣ +00:30:28 Sally Chang: Reacted to "This is starting to ..." with 1️⃣ +00:30:33 Olivier: Reacted to "This is starting to ..." with 😂 +00:30:38 Derek Sollberger: Reacted to "This is starting to ..." with 0️⃣ +00:30:41 Olivier: Reacted to "This is starting to ..." with 0️⃣ +00:30:42 Olivier: Reacted to "This is starting to ..." with 1️⃣ +00:30:45 Jon Harmon (jonthegeek): But don't feel like you have to have 10 years experience! 😄 +00:31:21 Jon Harmon (jonthegeek): Reacted to "This is starting to ..." with 🔟 +00:31:25 Derek Sollberger: Reacted to "This is starting to ..." with 🔟 +00:33:37 Sally Chang: Oh! Forgot to mention as someone in education I am also super excited to see how this club is organized and hopefully someday facilitate a book club myself :) +00:33:39 Olivier: () are the best +00:34:13 Olivier: Reacted to "Oh! Forgot to mentio..." with 👍 +00:35:43 Jon Harmon (jonthegeek): Reacted to "Oh! Forgot to mentio..." with 👍 +00:38:02 Gabby Palomo: Reacted to "Oh! Forgot to mentio..." with 👍 +00:41:33 BYRON DANIEL ODERA: My name is Byron. I'm calling in from Nairobi,Kenya ( past 8 pm here) Have been using R for 1 year plus now. I'm in behavioral-clinical research. My branching out is after trials with Python which i still find hard😅. I'm looking forward to this class and more R training to help with honing skills in computational genomics and learning from everyone. (Sorry cant be on mic having family dinner but I'm following) +00:41:40 Sally Chang: Reacted to "My name is Byron. I'..." with ❤️ +00:41:47 Sally Chang: Reacted to "My name is Byron. I'..." with 👋 +00:41:55 Gabby Palomo: Reacted to "My name is Byron. I'..." with ❤️ +00:42:11 Jon Harmon (jonthegeek): Reacted to "My name is Byron. I'..." with 👋 +00:42:14 Nicholas Giangreco: Reacted to "My name is Byron. I'..." with 👋 +00:42:56 Olivier: my cohort was so good that people are coming again! +00:43:01 Gabby Palomo: Reacted to "my cohort was so goo..." with 🤩 +00:43:02 Sally Chang: Reacted to "my cohort was so goo..." with 🎉 +00:43:04 Gabby Palomo: Reacted to "my cohort was so goo..." with 🎉 +00:43:08 Nicholas Giangreco: Reacted to "my cohort was so goo..." with 🤩 +00:44:56 Jon Harmon (jonthegeek): usethis::use_package("x") +00:45:47 Derek Sollberger: Yeah, that guy (Derek) didn't really make slides +00:45:53 Sally Chang: Reacted to "Yeah, that guy (Dere..." with 😂 +00:45:55 Olivier: Reacted to "Yeah, that guy (Dere..." with 😄 +00:45:57 Nicholas Giangreco: Reacted to "Yeah, that guy (Dere..." with 😂 +00:46:01 Retselisitsoe Monyake: Reacted to "Yeah, that guy (Dere..." with 😅 +00:49:23 Ella Kaye (she/her): But we’re bringing back C for R users! +00:49:41 Olivier: Reacted to "But we’re bringing b..." with 😄 +00:51:18 Gabby Palomo: Reacted to "Yeah, that guy (Dere..." with 😂 +00:51:46 Olivier: can we say Hi to the kiddo? +00:52:24 Eamon Caddigan: (My youngest is the same age!) +00:52:29 Gabby Palomo: We also sometime would like to see your dogs Jon. They are adorable!!! +00:52:29 Ella Kaye (she/her): Reacted to "(My youngest is the ..." with ❤️ +00:52:43 Sally Chang: Reacted to "We also sometime wou..." with ➕ +00:55:12 Olivier: that is optimist about replacing s3 and s4 :) +00:56:19 Olivier: having multiple systems also help you understand the one you are using +00:56:31 Retselisitsoe Monyake: Reacted to "having multiple syst..." with 👍 +00:57:15 Olivier: masstodon! +00:57:24 Eamon Caddigan: Reacted to "masstodon!" with 💯 +00:57:26 Nicholas Giangreco: Reacted to "masstodon!" with 💯 +00:57:56 Gabby Palomo: Replying to "masstodon!" + +I need to go back, I’ve been soaring the blue skies LOL +00:58:31 Olivier: Replying to "masstodon!" + +ahah that is fine, we still love all the blue sky users +00:58:38 Eamon Caddigan: Reacted to "ahah that is fine, w..." with ➕ +00:58:39 Gabby Palomo: Reacted to "ahah that is fine, w..." with ❤️ +00:58:48 Sally Chang: At this point in my job search, anything but linkedIn please 😫 +00:58:55 Gabby Palomo: Reacted to "At this point in my ..." with 😂 +00:58:57 Olivier: Reacted to "At this point in my ..." with 😂 +00:59:07 Josh Persi: Reacted to "At this point in my ..." with 😂 +00:59:10 Retselisitsoe Monyake: Reacted to "At this point in my ..." with 😂 +00:59:11 Derek Sollberger: Reacted to "At this point in my ..." with 😂 +00:59:58 Olivier: I just discovered that you need to use a third app to preview your post in LinkedIn ... +01:00:01 Gabby Palomo: My take on LinkedIn is that is really cool BUT you have to curate the people you follow very carefully to avoid the weirdos posting about how they finding success before breakfast and inspiration in their cereal. +01:00:08 Sally Chang: Reacted to "My take on LinkedIn ..." with ❤️ +01:00:12 Olivier: Reacted to "My take on LinkedIn ..." with ❤️ +01:00:16 Sally Chang: Reacted to "I just discovered th..." with 😫 +01:00:43 Nicholas Giangreco: Reacted to "My take on LinkedIn ..." with 😂 +01:02:40 Olivier: ones pro of being wrote by scientists is that it tends to be stable (always relative) +01:06:58 Olivier: I think it is a good advice, specialy to understand why it can fails +01:07:22 Eamon Caddigan: HUGE fan of SICP (aka “the Wizard Book”) +01:07:40 Olivier: I still never managed to finish it :P +01:07:47 Sally Chang: Reacted to "HUGE fan of SICP (ak..." with 🪄 +01:07:59 Nicholas Giangreco: Sorry I got to go to my next work meeting! I think I signed up to do the next chapter. Discussion so I will contribute to that on GitHub and be ready to facilitate next week 🙂 +01:08:14 Ella Kaye (she/her): Sorry I won’t be here next week, but looking forward to seeing you all again the week after. +``` +</details> diff --git a/videos/02/08.qmd b/videos/02/08.qmd @@ -0,0 +1,60 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/HBkRO13QlIM >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:13:07 Federica Gazzelloni (she/her): http://r4ds.io/advr +00:15:46 Federica Gazzelloni (she/her): start +00:52:35W Rebecca Butler: Does anyone know how to print out much more precision for obj_size? +00:53:02 Laura Biggins: No, I was going to ask the same question. +00:53:48 Federica Gazzelloni (she/her): https://advanced-r-solutions.rbind.io/names-and-values +00:56:51 Rebecca Butler: This is fun: +a <- runif(1e6) +a_size <- obj_size(a) + +b <- list(a, a) +b_size <- obj_size(b) + +b_size - a_size +# 64 B + +x <- 1 +y <- list(x, x) +obj_size(y) - obj_size(x) +# 64 B +00:58:40 Rebecca Butler: Replying to "This is fun: +a <- ru..." + +Kind of clarifies that it takes 64 B to make an empty list of length 2 +00:58:58 Laura Biggins: Replying to "This is fun: +a <- ru..." + +> obj_size(list(NULL)) +56 B +> obj_size(list(NULL, NULL)) +64 B +> obj_size(list(NULL, NULL, NULL)) +80 B +00:59:05 Rebecca Butler: Replying to "This is fun: +a <- ru..." + +empty_list2 <- vector("list", 2) +obj_size(empty_list2) +# 64 B + +empty_list3 <- vector("list", 3) +obj_size(empty_list3) +# 80 B +00:59:32 Rebecca Butler: Replying to "This is fun: +a <- ru..." + +Haha we were going the exact same place, Laura. yep! +00:59:44 Laura Biggins: Reacted to "Haha we were going t..." with 👍 +01:04:22 Federica Gazzelloni (she/her): stop +``` +</details> diff --git a/videos/02/09.qmd b/videos/02/09.qmd @@ -0,0 +1,46 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/SAKLWLy6Egw >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:05:29 Olivier Leroy: start +00:06:30 Gabby Palomo Munoz: You are in good company, we are all learning. +00:08:40 Olivier Leroy: You can also use [] full syntax +00:08:47 Olivier Leroy: Or [[]] +00:09:42 Jo Hardin: sometimes i want the variable to have a specific format. for example, in linear model output i want the variable to have a space in it (instead of an underscore). then i’ll leave the space in the variable and use it throughout my code as `explan variable` or whatever. +00:09:56 Olivier Leroy: Reacted to "sometimes i want the..." with 👍 +00:10:00 Derek Sollberger (he/him): Reacted to "sometimes i want the..." with 👍 +00:16:53 Olivier Leroy: That surprised me a lot +00:18:21 Derek Sollberger (he/him): Replying to "That surprised me a ..." + +Yes, in comp sci, we jump straight to the environment-eval global/local stuff +00:20:59 Olivier Leroy: Replying to "That surprised me a ..." + +I was assuming it changed it because of the function “local” +00:21:42 Derek Sollberger (he/him): Does this column vs row copy-in-place consideration play a role in how "tidy" includes "row: observation, column: variable"? +00:24:42 Joel Liebert: I just looked it up and yes the global string pool is limited to the current R session! +00:24:50 Isabel Fernandez Escapa: Reacted to "I just looked it up ..." with 👍 +00:24:51 Olivier Leroy: Reacted to "I just looked it up ..." with 👍 +00:24:51 Jo Hardin: Reacted to "I just looked it up ..." with 👍 +00:26:14 Olivier Leroy: Replying to "Does this column vs ..." + +No idea +00:26:29 Gabby Palomo Munoz: Reacted to "I just looked it up ..." with 👍 +00:27:00 Diana Garcia Cortes: Reacted to "I just looked it up ..." with 👍 +00:30:03 Derek Sollberger (he/him): Replying to "Screenshot2024_05_31_092416.jpg" + +"triple-double", says the Californians +00:42:49 Olivier Leroy: Namespace if that help +00:53:56 Olivier Leroy: Great question! +00:58:58 Jo Hardin: gotta run off to a different meeting. thanks for the great presentation today! +00:59:49 Olivier Leroy: Reacted to "gotta run off to a d..." with 👍 +01:00:15 Diana Garcia Cortes: I gotta run too. Thank you so much! See you next week +01:00:39 Olivier Leroy: Reacted to "I gotta run too. Tha..." with 👋 +01:02:20 Olivier Leroy: end +``` +</details> diff --git a/videos/02/10.qmd b/videos/02/10.qmd @@ -0,0 +1,101 @@ +--- +title: Cohort 10 +--- + +{{< video https://www.youtube.com/embed/_GIEEMuZYrs >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:07:45 Stephan Koenig: Isn’t it just F from revealjs? +00:08:06 Gabby Palomo: Reacted to "Isn’t it just F from..." with 👍 +00:08:11 Jon Harmon (jonthegeek): start +00:09:01 Jon Harmon (jonthegeek): https://adv-r.hadley.nz/names-values.html +https://DSLC.io/advr +https://r4ds.github.io/bookclub-advr/slides/02.html#/learning-objectives +00:13:10 Jon Harmon (jonthegeek): R lets you do really insane things as long as you put it in ticks: +[main 12:07:10] > `function` <- mean +[main 12:07:53] > function(x) {x + 1} +Warning message: +In mean.default(as.pairlist(alist(x = )), { : + argument is not numeric or logical: returning NA +[1] NA +00:18:15 Stephan Koenig: What happens with 1L:10L? +00:18:33 Josh Persi: Replying to "What happens with 1L..." + +I had the same question! +00:23:32 Jon Harmon (jonthegeek): Went off on a tangent. Currently running this. No limit so far! +var_name_start <- "x" +var_characters <- 1L +var_name <- paste(rep(var_name_start, var_characters), collapse = "") +assign(var_name, var_characters) +max_characters <- 99999L +while (get(var_name) == var_characters && var_characters <= max_characters) { + cli::cli_inform( + "{var_name} works!" + ) + var_characters <- var_characters + 1L + var_name <- paste(rep(var_name_start, var_characters), collapse = "") + assign(var_name, var_characters) +} +00:24:41 Jon Harmon (jonthegeek): Found the limit (with assign() at least): +Error in `assign()`: +! variable names are limited to 10000 bytes +00:26:27 Retselisitsoe Monyake: Replying to "What happens with 1L..." + +> a <- 1L:10L +> b <- 1L:10L +> lobstr::obj_addr(a) +[1] "0x19ea1229788" +> lobstr::obj_addr(b) +[1] "0x19ea0a4e148" + +Look like it gives different addresses +00:26:57 Stephan Koenig: Replying to "What happens with 1L…" +Thanks! +00:27:07 Stephan Koenig: Reacted to "> a <- 1L:10L +> b <-…" with 👍 +00:28:25 tataphani: Reacted to "> a <- 1L:10L +> b <-..." with 👍 +00:44:40 Stephan Koenig: So a character vectors acts much more like a list? +00:52:44 Stephan Koenig: So does the ALTREP stop if you change a single element for example in y? +00:52:44 Jon Harmon (jonthegeek): This helps show the efficiency: +[main 12:47:24] > obj_size(1:10) +680 B +[main 12:47:38] > obj_size(as.list(1:10)) +736 B +[main 12:47:45] > obj_size(1:100) +680 B +[main 12:47:50] > obj_size(as.list(1:100)) +6.45 kB +[main 12:47:53] > obj_size(1:1000) +680 B +[main 12:48:20] > obj_size(as.list(1:1000)) +64.05 kB +00:54:34 Jon Harmon (jonthegeek): [main 12:49:54] > x <- 1:100 +[main 12:50:13] > obj_size(x) +680 B +[main 12:50:16] > x[[1]] <- 2 +[main 12:50:27] > obj_size(x) +848 B +00:55:04 Eamon Caddigan: x <- 2^(1:1e1) +y <- 2^(1:1e4) +obj_size(x) +#> 176 B +obj_size(y) +#> 80.05 kB +00:56:17 Eamon Caddigan: Like how Python went from range to xrange back to range +00:56:27 Stephan Koenig: Can we inspect what ALTREP R is using for an object? +00:57:07 Jon Harmon (jonthegeek): Replying to "Can we inspect what ..." + +Not as far as I know, or at least not easily. We might learn how to do that toward the end when we learn about the C interface. +00:57:39 Stephan Koenig: Reacted to "Not as far as I know…" with 👍 +01:00:54 Eamon Caddigan: “Cons cells”? I low-key love when R shows its Lispyness. +01:01:53 Jon Harmon (jonthegeek): stop +01:02:09 Zachary Morford: Thank you all! I have to run but I'll be there next week. +01:02:16 Stephan Koenig: Thanks, Nick! +01:02:58 Jon Harmon (jonthegeek): https://github.com/r4ds/bookclub-advr?tab=readme-ov-file#how-to-present +01:03:39 Jon Harmon (jonthegeek): usethis::edit_r_profile() +``` +</details> diff --git a/videos/03/08.qmd b/videos/03/08.qmd @@ -0,0 +1,21 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/bvo_6s9F5pw >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:10:29 Federica Gazzelloni (she/her): start +00:15:26 Silvana Acosta: emoji +00:45:52 Rebecca Butler: Well, the documentation for is.integer clarifies 🙂 +is.integer returns TRUE or FALSE depending on whether its argument is of integer type or not, unless it is a factor when it returns FALSE. +00:46:12 Silvana Acosta: Reacted to "Well, the documentat..." with 💜 +00:57:08 Silvana Acosta: Sorry, need to drop. Almost 10 PM here 😅 Thank you everyone! Specially Betsy for the great presentation! 💜 +00:57:25 Federica Gazzelloni (she/her): Reacted to "Sorry, need to drop...." with 👋🏻 +00:57:41 Rebecca Butler: Reacted to "Sorry, need to drop...." with 👋🏻 +01:05:53 Federica Gazzelloni (she/her): stop +``` +</details> diff --git a/videos/03/09.qmd b/videos/03/09.qmd @@ -0,0 +1,73 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/3nhMBcL9WNw >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:04:26 Howard Baek: Good to see you again, Olivier +00:11:01 Derek Sollberger (he/him): start +00:18:16 Olivier Leroy: T is not a restricted name unlike TRUE: +00:18:17 Olivier Leroy: > TRUE <-"bob" +Error in TRUE <- "bob" : invalid (do_set) left-hand side to assignment +> T <- "bob" +> +00:22:03 Steffi LaZerte (she/her): nchar() +00:25:34 Olivier Leroy: A reference from War ? :p +00:25:39 Olivier Leroy: Wat +00:26:50 Olivier Leroy: (https://www.destroyallsoftware.com/talks/wat) +00:32:26 Howard Baek: I found a blog post discussing different flavors of NA: https://www.njtierney.com/post/2020/09/17/missing-flavour/ +00:32:47 Olivier Leroy: Brb just checking in an other book +00:36:12 Olivier Leroy: > x <- 1L +> is.numeric(x) +[1] TRUE +> y <- 1.4 +> is.numeric(y) +[1] TRUE +00:37:20 Olivier Leroy: > x <- 1 +> is.double(x) +[1] TRUE +00:39:51 Derek Sollberger (he/him): aside: banker's rounding +00:39:56 Olivier Leroy: > x <- 2.8 +> as.integer(x) +[1] 2 +00:40:04 Olivier Leroy: (truncated) +00:40:11 Howard Baek: Non-integral numeric values are truncated towards zero (i.e., as.integer(x) equals trunc(x) there) +00:40:29 Howard Baek: I found the above in the help page +00:40:34 Olivier Leroy: Reacted to "I found the above in..." with 👍 +00:40:38 tataphani: Reacted to "I found the above in..." with 👍 +00:40:39 Steffi LaZerte (she/her): Reacted to "Non-integral numeric..." with 👍🏻 +00:44:36 Jo Hardin: also, the integer class is complicated because factor variables are integers… sort of +00:44:48 Olivier Leroy: Reacted to "also, the integer cl..." with 👍 +00:44:52 Diana Garcia Cortes: Reacted to "also, the integer cl..." with 👍 +00:45:38 Howard Baek: Reacted to "also, the integer cl..." with 👍 +00:45:47 Howard Baek: Reacted to "Screenshot2024_06_07_094000.jpg" with 👍 +00:46:57 Vania: Reacted to "Screenshot2024_06_07_094000.jpg" with 👍 +00:47:45 Vania: Replying to "Screenshot2024_06_07_094000.jpg" + +I actually didn’t know this. Really interesting! +00:48:59 Steffi LaZerte (she/her): Reacted to "Jo Hardin has sent y..." with 😵💫 +00:49:08 Jo Hardin: Replying to "Screenshot2024_06_07_094000.jpg" + +i just learned said fact when reading the chapter for today’s meeting. 🙂 +00:50:53 Diana Garcia Cortes: Reacted to "Screenshot2024_06_07_094000.jpg" with 😵💫 +00:52:18 Howard Baek: From the help page: + +An array in R can have one, two or more dimensions. It is simply a vector which is stored with additional attributes giving the dimensions (attribute "dim") and optionally names for those dimensions (attribute "dimnames"). +A two-dimensional array is the same thing as a matrix. +00:53:02 Howard Baek: methods("print") +00:58:05 Derek Sollberger (he/him): (just for fun) "How to pronounce 'POSIXct'" +https://www.howtopronounce.com/pos(just for fun) "How to pronounce 'POSIXct'" +https://www.howtopronounce.com/posixct +00:58:15 Steffi LaZerte (she/her): Reacted to "(just for fun) "How ..." with 😂 +00:58:58 Olivier Leroy: Reacted to "(just for fun) "How ..." with 😂 +00:59:42 Jo Hardin: gotta run off to a different 10am meeting. thanks, Derek! +01:00:07 Steffi LaZerte (she/her): Reacted to "gotta run off to a d..." with 👋🏻 +01:01:22 Howard Baek: Reacted to "gotta run off to a d..." with 👋🏻 +01:01:57 Olivier Leroy: Reacted to "gotta run off to a d..." with 👋🏻 +01:03:14 Derek Sollberger (he/him): end +``` +</details> diff --git a/videos/03/10.qmd b/videos/03/10.qmd @@ -0,0 +1,112 @@ +--- +title: Cohort 10 +--- + +{{< video https://www.youtube.com/embed/HRL1EursTR8 >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:10:11 Jon Harmon (jonthegeek): start +00:16:09 Stephan Koenig: You can reassign `T` and `F` to other objects. so `TRUE` and `FALSE` more robust +00:16:25 Eamon Caddigan: Replying to "You can reassign `T`..." + +Oh, TIL! +00:16:31 Sally Chang: Reacted to "Oh, TIL!" with ➕ +00:16:43 Retselisitsoe Monyake: Reacted to "You can reassign `..." with 👍 +00:19:41 Jon Harmon (jonthegeek): If you think of NA as "unknown" I feel like all of the rules make sense. +00:19:55 Nicholas Giangreco: Reacted to "If you think of NA a..." with 👍 +00:20:13 Derek Sollberger: Replying to "If you think of NA a..." + +Makes less sense when "NA" is "North America" --- Data Mishaps Night +00:20:24 Ella Kaye (she/her): Reacted to "Makes less sense whe..." with 😂 +00:22:33 Jon Harmon (jonthegeek): https://DSLC.io/advr +00:32:31 Nicholas Giangreco: attr(a, “bob”) <- bob +00:35:53 Jon Harmon (jonthegeek): lobstr::obj_addr() +00:40:17 Eamon Caddigan: ``` +bob <- "bob" +alice <- "alice" +attr(alice, "friend") <- bob +attr(bob, "friend") <- alice +str(bob) +#> chr "bob" +#> - attr(*, "friend")= chr "alice" +str(alice) +#> chr "alice" +#> - attr(*, "friend")= chr "bob" +ref(bob) +#> [1:0x1098bebc8] <chr> +ref(attr(alice, "friend")) +#> [1:0x109883960] <chr> +``` +00:41:18 Eamon Caddigan: Replying to "attr(a, “bob”) <- bo..." + +Does this get at what you were asking about? It looks like bob is getting a new address when it gets modified, so Alice’s friend points to the original bob . +00:42:39 Stephan Koenig: I never understood the difference between an ordered factor and a regular one. Even the regular factor has an order to the levels, no? +00:43:38 Jon Harmon (jonthegeek): If you don't give it a tz, it leaves the tz as "" then assumes local when you use it, most of the time, if I recall correctly. That's one of the many things lubridate fixes +00:45:32 Jon Harmon (jonthegeek): Replying to "I never understood t..." + +Looks like the concept of "ordered" is largely leftover from S. Oh, and they say some other things might treat them differently. +00:45:54 Stephan Koenig: Reacted to "Looks like the conce..." with 🙏 +00:45:58 Nicholas Giangreco: Replying to "I never understood t..." + +An ordered factor has an extra class of “ordered” +00:46:21 Stephan Koenig: Reacted to "An ordered factor ha..." with 👍 +00:46:37 Ella Kaye (she/her): Replying to "I never understood t..." + +It’s relevant in some modelling contexts. I know I made use of them in my MSc, to represent student grade levels, but that was a while ago now and I can’t remember exactly what modelling I did. +00:48:00 Eamon Caddigan: Replying to "I never understood t..." + +The default contrasts for ordered factors are polynomial, and they’re dummy-coded for non-ordered factors. +00:48:10 Eamon Caddigan: Reacted to "It’s relevant in som..." with 💯 +00:48:17 Stephan Koenig: Reacted to "It’s relevant in som..." with 🙏 +00:48:22 Stephan Koenig: Reacted to "The default contras..." with 🙏 +00:51:26 Eamon Caddigan: If you find yourself writing a big loop and storing things in a list, you’ll want to preallocate an empty list, imho. Use vector(mode=“list”, length=<length>) +00:51:42 Nicholas Giangreco: Reacted to "If you find yourself..." with 👍 +00:51:52 Retselisitsoe Monyake: Reacted to "If you find yourse..." with 👍 +00:53:03 Stephan Koenig: Replying to "If you find yourself..." + +Why does that make a difference? I thought a list just contains pointers anyway. +00:53:07 Jon Harmon (jonthegeek): Replying to "If you find yourself..." + +Yes, but within the last couple years they made this much less important, if I recall correctly. +00:54:16 Sarah Rathwell: Replying to "If you find yourself..." + +Is there a reason to use that over list() ? I know the vector call version pre-specifies length but if you do know the desired length beforehand are the two methods different +00:54:53 Stephan Koenig: tibble recycles the length of one +00:55:08 Jon Harmon (jonthegeek): Replying to "If you find yourself..." + +Use vector() when you know you want a list with a certain length but you don't know what goes in it. If you're building a list with specified values, list() is fine. +00:56:53 Eamon Caddigan: Reacted to "Use vector() when yo..." with 💯 +00:56:53 Jon Harmon (jonthegeek): data.frame(x = 1:4, y = 1:2) +tibble(x = 1:4, y = 1:2) +00:59:34 Stephan Koenig: Data frames do partial matching. +01:00:49 Stephan Koenig: What is the `I` function? +01:01:05 Eamon Caddigan: Replying to "If you find yourself..." + +I’d defer to our other experts on R internals, but I believe that lists are “generic vectors” (of pointers to objects), but they’re not (e.g.) linked lists. So if you’re appending to them repeatedly eventually the whole vector of pointers is going to be copied to a new region of memory. +01:01:26 Stephan Koenig: Reacted to "I’d defer to our oth..." with 🙏 +01:02:11 Eamon Caddigan: Replying to "If you think of NA a..." + +I was recently burned by (not knowing about the default values of) the na argument to readr::read_csv . +01:02:30 Jon Harmon (jonthegeek): testing <- data.frame() +nrow(testing) + +testing <- NULL +nrow(testing) +NROW(testing) # Yell at R to give you an answer. +01:03:18 Eamon Caddigan: Reacted to "testing <- data.fram..." with 😂 +01:03:21 Nicholas Giangreco: Reacted to "testing <- data.fram..." with ❗ +01:05:15 Jacob Schwan: Reacted to "testing <- data.fram..." with 😂 +01:07:35 Stephan Koenig: Thank you, Olivier! +01:07:39 Sally Chang: Thank you, Olivier. That was A LOT of material +01:07:46 Eamon Caddigan: Thanks Olivier! +01:07:54 tataphani: Replying to "I never understood t..." + +end +01:07:55 Jacob Schwan: Thanks Olivier! +01:07:58 Olivier: end +01:08:02 Retselisitsoe Monyake: Thank you +``` +</details> diff --git a/videos/04/08.qmd b/videos/04/08.qmd @@ -0,0 +1,36 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/gQxiPquyfww >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:08:19 Federica Gazzelloni: Start +00:14:19 Rebecca Butler: It’ll (df) recycle as long as one length is a multiple of the other +00:23:29 Rebecca Butler: Has anyone ever run into that in the wild? +00:23:36 Rebecca Butler: Replying to "Has anyone ever run ..." + +Matrix or df columns, that is +00:25:07 Laura Biggins: Replying to "Has anyone ever run ..." + +Yes, but haven't enjoyed them... +00:25:58 Rebecca Butler: Replying to "Has anyone ever run ..." + +Do you remember where that came up? Did it feel somewhat appropriate (like it served some purpose, but was unenjoyable)? +00:27:17 Laura Biggins: Replying to "Has anyone ever run ..." + +I don't really remember, come up when working with other people's code. Not sure I've purposely created them myself. +00:27:23 Rebecca Butler: Reacted to "I don't really remem..." with 👍 +00:27:25 Rebecca Butler: Replying to "Has anyone ever run ..." + +thanks! +00:42:48 Rebecca Butler: (For the pic, the rightmost bracket was just cut off - The original pepper tweet actually has x[[1]][[1]] for the pile of pepper - https://pbs.twimg.com/media/CO2_qPVWsAAErbv?format=png&name=large) +00:46:13 Silvana Acosta: When reading I got a bit lost with the example: a[c(TRUE, FALSE, TRUE), c("B", “A”)] +00:47:05 Silvana Acosta: The first example here: https://adv-r.hadley.nz/subsetting.html#matrix-subsetting +00:47:39 Silvana Acosta: I don’t think I fully see the 2nd row it produces +01:03:05 Betsy: end +``` +</details> diff --git a/videos/04/09.qmd b/videos/04/09.qmd @@ -0,0 +1,105 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/PqKQP6hS1z4 >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:05:22 Olivier Leroy: Sorry for being late +00:06:00 Diana Garcia Cortes: Hi everyone! +00:06:35 Olivier Leroy: Start +00:06:39 Derek Sollberger (he/him): The data frame and tibble info will come up again here in chapter 4 anyway +00:06:45 Olivier Leroy: Reacted to "The data frame and t..." with 👍 +00:10:03 Olivier Leroy: (The use of number on x was so smart 😛) +00:11:31 Olivier Leroy: People who index with float are evil! +00:12:48 Derek Sollberger (he/him): Replying to "People who index wit..." + +might be useful in some sort of median index calculation +00:13:19 Olivier Leroy: Reacted to "might be useful in s..." with 👍 +00:13:31 Olivier Leroy: Replying to "People who index wit..." + +Yup but probably to smart for me +00:18:17 Olivier Leroy: Double quote +00:18:39 Olivier Leroy: Unless I am dealing with quote in the string +00:19:02 Diana Garcia Cortes: Reacted to "Double quote" with ➕ +00:20:50 Olivier Leroy: I like the eggs and box of eggs example +00:23:17 tataphani: { names of all the students in the class and {{ Just one name +00:24:47 tataphani: so {{ would work on both Lists and Vectors ? and same is true for $ +00:25:34 Jo Hardin: {{ isn’t used for subsetting, as far as I know. +00:25:41 Olivier Leroy: r$> x <- letters + +r$> x[[1]] +[1] "a" +00:25:52 Jeffrey Stevens: $ doesn't work on vectors +00:27:10 Jeffrey Stevens: Unless the vector is named? +00:27:23 Olivier Leroy: If the vector is named I think it will works +00:27:30 Olivier Leroy: Need to try 😛 +00:28:12 Jeffrey Stevens: Nope, doesn't seem to work with named vectors +00:28:32 Jo Hardin: my_list[[c(1,2)]] is the same as my_list[[1]][[2]] +00:28:57 Jeffrey Stevens: "Error in x$c : $ operator is invalid for atomic vectors" +00:29:12 Jo Hardin: Can’t unmute today! +00:29:16 Jo Hardin: Sorry +00:29:16 Jeffrey Stevens: So $ can't be used for atomic vectors +00:29:22 Jo Hardin: Thanks ❤️ +00:30:33 Olivier Leroy: From ?`$` + +> ‘$’ is only valid for recursive objects (and ‘NULL’), + and is only discussed in the section below on recursive objects. +00:30:37 Jo Hardin: Maybe easier to demo w my_list[[2]][[4]] +00:30:51 Jeffrey Stevens: Reacted to "From ?`$` + +> ‘$’ is..." with 👍 +00:31:41 Olivier Leroy: `$` +00:33:09 Olivier Leroy: Return: + +r$> `$` +.Primitive("$") +00:35:56 Olivier Leroy: Reacted to "Nope, doesn't seem t..." with 👍 +00:39:21 Jo Hardin: Just realized from your example that by using 0 for the row index, you can get the column names. That’s useful! +00:39:31 Olivier Leroy: Reacted to "Just realized from y..." with 👍 +00:39:43 Derek Sollberger (he/him): Reacted to "Just realized from y..." with 🧐 +00:40:22 Olivier Leroy: Replying to "Just realized from y..." + +I will need to try, but maybe it is just print and you can’t assign ? +00:40:49 Jo Hardin: Replying to "Just realized from y…" +Ahhh, right, that makes sense. +00:41:20 tataphani: can we also check if matrix empty or not ? +00:43:15 Jeffrey Stevens: names() +00:45:04 Olivier Leroy: Subsetting seems simple but it is so tricky +00:45:18 Jeffrey Stevens: What's the difference between names() and colnames()? +00:45:44 Jeffrey Stevens: Ah, so names() doesn't work on matrices? +00:49:09 Derek Sollberger (he/him): NROW() and NCOL() [with capital letters] was in exercise 2 of section 3.3.4 +00:49:39 Olivier Leroy: Reacted to "NROW() and NCOL() [w..." with 👍 +00:49:52 Howard Baek: Reacted to "NROW() and NCOL() [w..." with 👍 +00:50:18 Derek Sollberger (he/him): Replying to "NROW() and NCOL() [w..." + +"dim() will return NULL when applied to a 1d vector. +One may want to use NROW() or NCOL() to handle atomic vectors, lists and NULL values in the same way as one column matrices or data frames. For these objects nrow() and ncol() return NULL" +00:51:08 Howard Baek: Replying to "NROW() and NCOL() [w..." + +Sounds like a C function used in R +00:52:06 Howard Baek: Replying to "NROW() and NCOL() [w..." + +Nvm, NCOL is base +00:53:01 Olivier Leroy: [ always simplify +00:53:06 Olivier Leroy: Except on tibble +01:04:08 Olivier Leroy: We are out of time I can continue if needed +01:04:22 tataphani: please +01:04:33 Howard Baek: Me too, I can stay longer +01:04:37 Olivier Leroy: Reacted to "please" with 👍 +01:04:39 Olivier Leroy: Reacted to "Me too, I can stay l..." with 👍 +01:04:57 Tinashe Tapera: I have to go but reminder I am presenting next week! Wish my luck 👌 +01:05:12 Olivier Leroy: Replying to "I have to go but rem..." + +Good luck 😛 +01:05:25 Howard Baek: Reacted to "I have to go but rem..." with 👍 +01:12:50 Olivier Leroy: Btw they will have a base R function for that soon (the subset with order()) +01:14:45 Olivier Leroy: I like that trick +01:15:33 Olivier Leroy: Kids crashed here sorry 🙂 +01:16:27 Aaron Grzasko: I need to drop. Great conversation today! Good job, Gabby!. +01:17:58 Olivier Leroy: End +``` +</details> diff --git a/videos/04/10.qmd b/videos/04/10.qmd @@ -0,0 +1,35 @@ +--- +title: Cohort 10 +--- + +{{< video https://www.youtube.com/embed/0Gov9xKVf1E >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:05:24 Olivier Leroy: my windows manager handle the zoom chat terribly! +00:06:14 Jon Harmon (jonthegeek): start +00:06:24 Olivier Leroy: the same, I still not have added a volume button and neither a battery status .. +00:09:11 Olivier Leroy: I do not want to play with that for indexing +00:11:42 Olivier Leroy: if you are using a counter to index stuff maybe +00:11:56 Derek Sollberger: truncate to zero + R doesn't start at zero: ignore +00:16:00 Olivier Leroy: will it loose attributes? +00:16:04 Olivier Leroy: (testing) +00:16:12 Olivier Leroy: x[] +00:17:00 Olivier Leroy: keeping it +00:23:15 Olivier Leroy: brb fast +00:26:02 Olivier Leroy: better than using as.data.frame after droping .... +00:28:20 Ella Kaye: Wouldn’t x[[1]][[1]] be a single speck of pepper? +00:28:39 Ella Kaye: Ahh! +00:28:49 Olivier Leroy: we can test +00:30:33 Olivier Leroy: x <- list(list(1:2), list(3:4)); x[[1]][[1]] +00:31:19 Olivier Leroy: yup return: [1] 1 2 +00:37:35 Olivier Leroy: create a fake table fast? +00:41:44 Olivier Leroy: it is good if you want to join a data frame that was a summary and want to join it back to the "original" data frame +00:45:39 Olivier Leroy: is it how start_with_() is implemented? (unsure of the function name) +00:55:31 Ella Kaye: I won’t be here next week, I’m afraid, but looking forward to catching up on the recording, and should be back the following week. +00:55:40 Jon Harmon (jonthegeek): stop +00:55:43 Stephan Koenig: Thanks! +``` +</details> diff --git a/videos/05/08.qmd b/videos/05/08.qmd @@ -0,0 +1,27 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/LnoOo-TFGkI >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:04:59 Federica Gazzelloni (she/her): start +00:44:21 Betsy: text <- c("al", "bob", "charlie") + +for (i in seq_along(text)) { + print(text[[i]]) +} + +for (i in seq_along(text)) { + print(i) +} + +for (name in text) { + print(name) +} +00:53:43 Federica Gazzelloni (she/her): Stop +``` +</details> diff --git a/videos/05/09.qmd b/videos/05/09.qmd @@ -0,0 +1,176 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/gwsc8fjMqXQ >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:10:23 Steffi LaZerte (she/her): start +00:16:13 Steffi LaZerte (she/her): isTRUE(x) is a really specific test of whether something is TRUE +00:17:49 Joel Liebert: Thanks Steffi, I wasn't familiar with that function. From the docs: "isTRUE(x) is the same as { is.logical(x) && length(x) == 1 && !is.na(x) && x }" +00:17:58 Steffi LaZerte (she/her): Reacted to "Thanks Steffi, I was..." with 👍🏻 +00:19:11 Steffi LaZerte (she/her): This was brand new to me! I had no idea that the implied FALSE was NULL. +00:19:12 Derek Sollberger (he/him): neat! … I hadn't heard that function called "paste oh" before +00:19:43 Steffi LaZerte (she/her): paste0() changed my life :🤣 +00:20:00 Gabby Palomo: I have always had problems coming out in ways to use if else etc in my functions. I guess the best example is the function if the package is not installed then install it. But I was wondering if anyone else had examples on your blog or GitHub please share them with me here or on Slack. I feel like if I see examples then I will start to see how to use them in my own functions. +00:20:25 Gabby Palomo: paste0 for the win. But I want to start using glue too. +00:20:34 Steffi LaZerte (she/her): Reacted to "paste0 for the win. ..." with 👍🏻 +00:21:51 Derek Sollberger (he/him): Replying to "I have always had pr..." + +as a teacher, I tend to use if_else() en route to teaching about dummy variables (one-hot encoding) + +new_col = if_else(chr_vec == "this label", 1, 0) +00:22:18 tataphani: Are there any difference between paste and glue we can discuss later +00:22:19 Gabby Palomo: Reacted to "as a teacher, I tend..." with 💯 +00:22:40 tataphani: sure +00:23:33 Steffi LaZerte (she/her): Replying to "I have always had pr..." + +I use it a lot when evaluating different arguments in a function. So if the function could have an argument of blue or green, I'll use an ifelse() to deal with the switch. Or if the argument is something like "total" vs. "summary", I'll use if() {} else {} to do different calculations based on that argument. Is this the kind of example you were thinking about? +00:24:29 Steffi LaZerte (she/her): If anyone uses chunk options in Quarto/Rmarkdown, I always make the mistake of forgetting that in THOSE cases it really is 'true' and not TRUE :) +00:24:36 Gabby Palomo: Replying to "I have always had pr..." + +I totally see the total and summary!! You are right, perfect example to use if else etc. I see this. YEs this is what I'm looking for. +00:24:59 Gabby Palomo: Replying to "If anyone uses chunk..." + +yeah in the yaml too +00:25:00 Derek Sollberger (he/him): Reacted to "I use it a lot when ..." with 😻 +00:25:08 Steffi LaZerte (she/her): Reacted to "I totally see the to..." with 👍🏻 +00:25:25 Steffi LaZerte (she/her): Reacted to "yeah in the yaml too" with 💯 +00:27:14 Leo: our conclusion from the first 2 sections is that "if (anytext)" will always return FALSE? +00:30:03 Steffi LaZerte (she/her): I'm glad you brought this up! I totally missed the idea of cascading 'true' to TRUE, yikes! +00:30:29 tataphani: Replying to "our conclusion from ..." + +is it true for other +00:30:37 tataphani: Replying to "our conclusion from ..." + +like FALSE +00:30:42 tataphani: Replying to "our conclusion from ..." + +or NA +00:31:03 tataphani: Replying to "our conclusion from ..." + +or something +00:35:14 tataphani: Replying to "our conclusion from ..." + +it is like CASE and WHEN in SAS +00:35:36 tataphani: Replying to "our conclusion from ..." + +? +00:38:00 Steffi LaZerte (she/her): I think you can quote or not the switch labels (like a named vector or list) +00:39:05 tataphani: Replying to "our conclusion from ..." + +never mind +00:41:15 Steffi LaZerte (she/her): dplyr::case_match() is another option, more similar to base switch() (but I can't say I'm very comfortable using it!) +00:43:47 Gabby Palomo: Reacted to "dplyr::case_match() ..." with 🤯 +00:46:44 Gabby Palomo: That explained it perfectly Steffi!! +00:47:26 Gabby Palomo: I don't want to rush things because I love these discussions but it's 40 min after the hour. +00:48:30 Leo: the .default argument is used to set what NA would return? +00:49:13 Steffi LaZerte (she/her): It would return the value if none of the other options matched +00:49:33 tataphani: soory +00:49:54 Steffi LaZerte (she/her): I'm just as bad 😁 Just means it's a good discussion! +00:50:37 Diana Garcia Cortes: Small example in the iris dataset: +as_tibble(iris) %>% + janitor::clean_names() %>% + mutate( + is_setosa = case_match(species, "setosa" ~ "yes", .default = "no"), + big_sepal = case_when(sepal_length > 5 & sepal_width > 3 ~ "big", .default = "small") + ) +00:50:55 Steffi LaZerte (she/her): Reacted to "Small example in the..." with 💯 +00:50:57 Gabby Palomo: Oh I love them too!! Don't get me wrong, but maybe we can save some of them and review them all at the end once we've gone over the chapter. +00:51:01 Derek Sollberger (he/him): Reacted to "Small example in the..." with 👍 +00:51:09 Steffi LaZerte (she/her): Reacted to "Oh I love them too!!..." with 👍🏻 +00:51:23 Gabby Palomo: Reacted to "Small example in the..." with 💯 +00:52:10 tataphani: Reacted to "Small example in the..." with 👍 +00:52:17 Gabby Palomo: I love using i j k it makes me feel like a mathematician LOL +00:52:24 Gabby Palomo: Don't take them from me!!! +00:52:36 Diana Garcia Cortes: Reacted to "I love using i j k i..." with ❤️ +00:52:41 Steffi LaZerte (she/her): Reacted to "Don't take them from..." with 🤣 +00:56:18 Gabby Palomo: seq_along is similar to using length(vector) ? +00:56:40 Steffi LaZerte (she/her): And safer +00:56:57 Gabby Palomo: switching to seq_along() from now on +00:57:00 Leo: is it correct that for loop can pretty much be replaced by ifelse statement? and usually ifelse would be faster? +00:57:07 Steffi LaZerte (she/her): I always get it mixed up with seq_len() though +00:57:39 Steffi LaZerte (she/her): Replying to "is it correct that f..." + +Not quite. A For loop is more about repitition rather than choices +00:57:41 Gabby Palomo: Oh no... what? So what's the difference? +01:00:22 Steffi LaZerte (she/her): Replying to "is it correct that f..." + +So a for loop repeats a set of code over and over, but a if/else does code 1 if true and code 2 if false, but only once +01:00:26 Diana Garcia Cortes: seq_len(iris) -> error +01:00:35 Diana Garcia Cortes: seq_along(iris) +[1] 1 2 3 4 5 6 7 +01:00:36 Gabby Palomo: YES MAP AND APPLY!! +01:00:37 Steffi LaZerte (she/her): Reacted to "seq_len(iris) -> err..." with 😞 +01:00:40 Gabby Palomo: I was gonna ask that +01:00:57 Diana Garcia Cortes: Reacted to " YES MAP AN..." with 👍 +01:00:58 Steffi LaZerte (she/her): Replying to "seq_along(iris) +[1] ..." + +seq_len(nrow(iris)) +01:01:10 Steffi LaZerte (she/her): Replying to "seq_along(iris) +[1] ..." + +> seq_len(nrow(iris)) +[1] 1 2 3 4 5 6 7 8 .... +01:01:24 Joel Liebert: repeat() seems similar to `while(true)` + +x <- 1 +repeat { + print(x) + x = x+1 + if (x == 6){ + break + } +} +01:02:19 Leo: Replying to "is it correct that f..." + +thank you +01:02:54 Derek Sollberger (he/him): When _apply was faster than loops, it was maybe back when loops created new value spaces at each iteration? (referring back to chapter 2) +01:04:10 Steffi LaZerte (she/her): Replying to "When _apply was fast..." + +Yes! I was wondering about that too! I had also heard that for loops used to be less efficient but that had changed. +01:04:21 Gabby Palomo: Reacted to "When _apply was fast..." with 💯 +01:05:41 Gabby Palomo: Loved that Diana thanks!! +01:06:09 Gabby Palomo: Readable code. I love that reason. +01:07:26 Gabby Palomo: My cognitive load or the computers? +01:07:33 Diana Garcia Cortes: Sorry, the phrase I was looking for was: avoid side effects. +01:07:40 Diana Garcia Cortes: https://medium.com/@alonr110/elevate-your-code-best-practices-for-function-writing-16d96481c0c7 +01:07:44 Gabby Palomo: Reacted to "Sorry, the phrase I ..." with 🤯 +01:07:49 tataphani: was that the Idea of DPLYR +01:07:50 Gabby Palomo: Reacted to "https://medium.com/@..." with 💯 +01:08:05 Steffi LaZerte (she/her): One thing that is nice about for loops is that you can 'jump' in at any time to test things out. But if you learn the browser() function to put that in your map functions, that gives you the same power :D +01:08:29 Gabby Palomo: Replying to "One thing that is ni..." + +teach me your esoteric ways!!!! +01:08:31 Steffi LaZerte (she/her): Replying to "My cognitive load or..." + +I think yours :D +01:08:47 Steffi LaZerte (she/her): end +01:08:56 Derek Sollberger (he/him): Reacted to "One thing that is ni..." with 🧐 +01:09:34 Gabby Palomo: Reacted to "One thing that is ni..." with 🧐 +01:10:22 Steffi LaZerte (she/her): Replying to "One thing that is ni..." + +We'll get to it! https://adv-r.hadley.nz/debugging.html#browser +01:10:36 Steffi LaZerte (she/her): Replying to "One thing that is ni..." + +Another function that changed my life :) +01:11:32 Gabby Palomo: Replying to "One thing that is ni..." + +I am an old Padawan I have much to learn +01:11:50 Gabby Palomo: Reacted to "We'll get to it! htt..." with 💯 +01:12:12 Steffi LaZerte (she/her): Replying to "One thing that is ni..." + +It never stops! +01:12:20 Gabby Palomo: Reacted to "It never stops!" with ❤️ +01:12:23 Derek Sollberger (he/him): Thank you for this great example of `glue` +01:12:35 Gabby Palomo: Reacted to "Thank you for this g..." with 💯 +01:12:37 Diana Garcia Cortes: Ok like python f-strings +01:13:27 Diana Garcia Cortes: Thanks! I didn’t know the glue package +01:14:23 Leo: many thanks +01:15:54 tataphani: thanks +``` +</details> diff --git a/videos/06/08.qmd b/videos/06/08.qmd @@ -0,0 +1,23 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/UD4DCDuUpg0 >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:12:27 Federica Gazzelloni: start +00:42:47 jim : Promises are covered in later chapter +00:42:58 Rebecca Butler: Reacted to "Promises are covered..." with 👍 +00:49:40 jim : Yes +00:49:47 jim : Lazy eval +00:52:20 jim : X is evaluated only at very last moment +00:56:24 Rebecca Butler: Reacted to "X is evaluated only ..." with 👍 +01:08:29 Federica Gazzelloni: stop +01:08:52 jim : Thx +``` +</details> + +{{< video https://www.youtube.com/embed/YdIt-ATfTQo >}} diff --git a/videos/06/09.qmd b/videos/06/09.qmd @@ -0,0 +1,190 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/krPNeIt9qU4 >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:11:08 Steffi LaZerte (she/her): I'll have to leave about 15-20min early today, sorry in advance! +00:11:40 Olivier Leroy: start +00:16:14 Steffi LaZerte (she/her): https://www.rstudio.com/wp-content/uploads/2016/02/advancedR.pdf +00:16:27 Howard Baek: Reacted to "https://www.rstudio...." with 👍 +00:16:30 Jeffrey Stevens: Reacted to "https://www.rstudio...." with 👍 +00:16:32 Olivier Leroy: https://www.rstudio.com/wp-content/uploads/2016/02/advancedR.pdf +00:16:34 Olivier Leroy: Reacted to "https://www.rstudio...." with 👍 +00:16:41 Olivier Leroy: Ahah you were faster :p +00:16:55 Steffi LaZerte (she/her): Reacted to "Ahah you were faster..." with 😛 +00:18:47 Gabby Palomo Munoz: I think you mean the arguments. +00:19:12 Olivier Leroy: Btw R return the last statement in a body function (always bit me) unless you have return() +00:19:50 Jo Hardin: what happens if you have two `return()` statements? +00:20:31 Steffi LaZerte (she/her): I think the first one it hits is the one it uses, so if you have an if / else you can have multiple returns +00:20:35 Olivier Leroy: The first one, I think has it exit the function to the parent environment +00:20:43 Jo Hardin: i’ve also always called them “arguments” but the chapter makes a big deal about calling them “formals”. +00:21:18 Olivier Leroy: formal() ? +00:21:19 Jo Hardin: does anyone know why “formals” instead of “arguments”? and how they might be different? +00:21:20 Steffi LaZerte (she/her): I use options > arguments > (and now) formals, in order of increasing complexity or nit-pickyness :D +00:21:38 Gabby Palomo Munoz: formals? interesting? I thought it was arguments +00:22:07 Olivier Leroy: > sum +function (..., na.rm = FALSE) .Primitive("sum") +00:23:47 Steffi LaZerte (she/her): Replying to "does anyone know why..." + +In the ?formals, they call them "formal arguments" +00:24:47 Olivier Leroy: Mean seems to dispatch +00:27:29 Olivier Leroy: I have this one on env function that always blew my mind: + + ctr <- 0 + f <- function(){ + ctr <<- ctr + 1 + cat("this count currently has value", ctr, "\n") + } +} + +c1 <- counter() +c2 <- counter() + + +c1() +c1() +c2() +ctr +00:28:40 Steffi LaZerte (she/her): Replying to "I have this one on e..." + +I hate this 😅 +00:28:45 Steffi LaZerte (she/her): So scary! +00:30:26 Olivier Leroy: Reacted to "So scary!" with 👻 +00:31:49 Howard Baek: Inside purrr functions +00:31:52 Gabby Palomo Munoz: Reacted to "Inside purrr functio..." with 💯 +00:31:59 Diana Garcia Cortes: Reacted to "Inside purrr functio..." with 💯 +00:31:59 Gabby Palomo Munoz: Replying to "Inside purrr functio..." + +I was just gonna say this :D +00:32:27 Howard Baek: Replying to "Inside purrr functio..." + +That’s the only place I use em 😄 +00:32:44 Gabby Palomo Munoz: Replying to "Inside purrr functio..." + +Yes apply and purrr ... trying to think where else... +00:34:53 Steffi LaZerte (she/her): Replying to "Inside purrr functio..." + +Me too, I was thinking today how much I've been using multiline anonymous functions to map over a set of database connections in one of my projects +00:35:36 Derek Sollberger (he/him): "funs" here seems like when many R programmers would make a code package instead +00:38:20 Gabby Palomo Munoz: If we are going to see this later in another chapter maybe we can just move on with the rest. I'm sorry, not trying to be mean but we only have an hour. +00:38:35 Gabby Palomo Munoz: Ha 'mean' no pun intended. +00:38:46 Olivier Leroy: r$> mean[1] +Error in mean[1] : object of type 'closure' is not subsettable +00:38:55 Steffi LaZerte (she/her): That's where I know the term! Yes! "Closure is not subsettable" +00:39:23 Steffi LaZerte (she/her): Reacted to "Ha 'mean' no pun int..." with 😅 +00:40:31 Derek Sollberger (he/him): Replying to "That's where I know ..." + +Jenny Bryan's famous rstudio::conf() 2020 talk "Object of type 'closure' is not subsettable" (about debugging) + +https://www.youtube.com/watch?v=vgYS-F8opgE +00:40:41 Gabby Palomo Munoz: Reacted to "Jenny Bryan's famous..." with 💯 +00:41:09 Steffi LaZerte (she/her): Reacted to "Jenny Bryan's famous..." with 💯 +00:41:12 Olivier Leroy: Reacted to "Jenny Bryan's famous..." with 💯 +00:41:16 Gabby Palomo Munoz: Replying to "That's where I know ..." + +I swear there's always a Jenny Bryan's talk somewhere to clarify any complex topic +00:41:33 Jo Hardin: Reacted to "I swear there's alwa..." with 💯 +00:43:29 Olivier Leroy: do.call(rbind, lapply(bucket[["Contents"]]), function(x) x[["Key"]]) + +Is a way to list all key in a s3 bucket as an example of args/anonymous function +00:44:29 Gabby Palomo Munoz: Quick question about do.call() Let's say I have a function I created that has three arguments. my_fun <- function(x, y, z){ body} and then I use it in do.call(). I just list the arguments as this: do.call(list, list$x, list$y, list$z) +00:44:42 Olivier Leroy: Reacted to "Quick question about..." with 👍 +00:44:45 Gabby Palomo Munoz: I am always confused by this which is why I go to lapply LOL but I like do.call() +00:45:15 Olivier Leroy: Do.call(function, list(named args)) +00:45:35 Derek Sollberger (he/him): Replying to "I am always confused..." + +Agree. I think do.call() is useful to mention en route to learning about *apply() +00:45:41 Gabby Palomo Munoz: Replying to "Quick question about..." + +Yes the function goes first lol, and then I list the arguments. Oh perfect. thanks Olivier!!! +00:45:50 Olivier Leroy: Reacted to "Yes the function goe..." with 👍 +00:45:50 Gabby Palomo Munoz: Reacted to "Agree. I think do.c..." with ❤️ +00:46:51 Olivier Leroy: This one overwriting the same name is so dangerous 😛 +00:47:23 Gabby Palomo Munoz: Replying to "This one overwriting..." + +temp +00:47:38 Gabby Palomo Munoz: Reacted to "This one overwriting..." with 💯 +00:48:36 Derek Sollberger (he/him): caution: the magrittr pipe might still be needed for ".", for example: + +df %>% lm(y ~ x, data = .) +00:48:54 Steffi LaZerte (she/her): Replying to "caution: the magritt..." + +You can use +00:48:55 Gabby Palomo Munoz: Replying to "caution: the magritt..." + +but not with the native pipe? +00:49:01 Steffi LaZerte (she/her): Replying to "caution: the magritt..." + +df |> lm(y ~ x, data = _) +00:49:07 Derek Sollberger (he/him): Reacted to "df |> lm(y ~ x, data..." with 😻 +00:49:14 Gabby Palomo Munoz: Replying to "caution: the magritt..." + +Actually, I am not clear on when to use the . so I use it whenever I see an error +00:49:26 Steffi LaZerte (she/her): Replying to "caution: the magritt..." + +But it's not as flexible and must be a named argument and can't be inside another nested function (drives me nuts!) +00:49:35 Gabby Palomo Munoz: Reacted to "df |> lm(y ~ x, data..." with 🤯 +00:49:35 Howard Baek: Do you guys load magrittr when you are using its other operators like %T>%? +00:50:28 Gabby Palomo Munoz: Replying to "Do you guys load mag..." + +I use |> but I have it set like this in RStudio settings. If you have the magrittr pipe as default then you don't have to load the package. At least that's my understanding. +00:50:38 Steffi LaZerte (she/her): Replying to "Do you guys load mag..." + +Sometimes, but I use that operator so rarely, it's usually easier (and easier to read) to just break out of the pipe for it +00:50:48 Howard Baek: Replying to "Do you guys load mag..." + +Yeah I agree +00:51:18 Steffi LaZerte (she/her): Replying to "Do you guys load mag..." + +Now I'm trying to use the base pipe as my default (it also looks better in my font :D ) +00:51:26 Derek Sollberger (he/him): Reacted to "I use |> but I have ..." with 🧐 +00:52:01 Howard Baek: Replying to "Do you guys load mag..." + +Are you using the Hadley font? +00:52:20 Olivier Leroy: Reacted to "df |> lm(y ~ x, data..." with 🤯 +00:52:25 Steffi LaZerte (she/her): Replying to "Do you guys load mag..." + +Fira Code +00:52:33 Steffi LaZerte (she/her): Replying to "Do you guys load mag..." + +I had no idea there was a Hadley font! +00:52:34 Howard Baek: Replying to "Do you guys load mag..." + +Yeah same haha +00:52:42 Gabby Palomo Munoz: Replying to "Do you guys load mag..." + +the native pipe is so much cleaner looking I agree +00:52:45 Steffi LaZerte (she/her): I have to run everyone, sorry! It's been a great conversation, see you next week! +00:52:51 Olivier Leroy: Reacted to "I have to run everyo..." with 👋 +00:52:51 Howard Baek: Replying to "Do you guys load mag..." + +Oh I meant the font that Hadley Wickham uses, which is FiraCode +00:52:52 Gabby Palomo Munoz: Reacted to "I have to run everyo..." with 👍🏻 +00:52:55 Howard Baek: Reacted to "I have to run everyo..." with 👋 +00:52:58 Howard Baek: Reacted to "I have to run everyo..." with 👍🏻 +00:52:59 Steffi LaZerte (she/her): Replying to "Do you guys load mag..." + +Ohhhhhhh! +00:53:04 Howard Baek: Reacted to "Ohhhhhhh!" with 😂 +00:55:30 Gabby Palomo Munoz: I found this for the FiraCode Font because if Hadley uses it I want it LOL https://github.com/tonsky/FiraCode/wiki/RStudio-instructions +00:56:52 Howard Baek: Replying to "I found this for the..." + +Yes, that is exactly why I’m using FiraCode +00:56:58 Howard Baek: Reacted to "I found this for the..." with 😂 +00:57:07 Gabby Palomo Munoz: Reacted to "Yes, that is exactly..." with 😂 +00:57:20 Gabby Palomo Munoz: Replying to "I found this for the..." + +Well I am copying you now LOL +00:57:27 Howard Baek: Reacted to "Well I am copying yo..." with 😂 +00:58:07 Howard Baek: I gotta run everyone, see you all next week!!! +00:58:12 Olivier Leroy: Reacted to "I gotta run everyone..." with 👋 +00:58:53 Gabby Palomo Munoz: Reacted to "I gotta run everyone..." with 👋 +01:07:34 Diana Garcia Cortes: great! Thank you +01:07:38 Olivier Leroy: end +``` +</details> diff --git a/videos/07/08.qmd b/videos/07/08.qmd @@ -0,0 +1,5 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/YdIt-ATfTQo >}} diff --git a/videos/07/09.qmd b/videos/07/09.qmd @@ -0,0 +1,125 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/WaGydI-0eDk >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:09:26 Jo Hardin: sorry, didn’t mean to have my mic on! i’m driving in the car, so won’t be able to say much. +00:09:34 Olivier Leroy: Reacted to "sorry, didn’t mean t..." with 👍 +00:09:38 Jo Hardin: *i’m not actually *driving*. +00:10:45 Tinashe Tapera: American holidays are so rare I was so surprised when I moved here +00:13:10 Derek Sollberger (he/him): Yes, kudos for making the slides! +00:13:27 Steffi LaZerte (she/her): Reacted to "Yes, kudos for makin..." with 💯 +00:14:01 Olivier Leroy: Reacted to "Yes, kudos for makin..." with 💯 +00:18:21 Olivier Leroy: I have done a quick check on internet and did not find good ressource on dynamic / lexical scoping (except an SO post) +00:18:33 Jo Hardin: Reacted to "I have done a quick ..." with 👍 +00:22:12 Steffi LaZerte (she/her): I think env_parents() stops if you use a created environment +00:24:08 Derek Sollberger (he/him): Replying to "I think env_parents(..." + +It seems like every week we learning something new that was brought by rlang or the tidyverse :-) +00:24:29 Olivier Leroy: ecur <- globalenv() # starting point +repeat { + cat(paste0(format(ecur), " (", attr(ecur, "name"), ")")) # pretty-print + + if (exists("<", envir=ecur, inherits=FALSE)) # look for `<` + cat(strrep(" ", 25), "`<` found here!") + cat("\n") + + ecur <- parent.env(ecur) # advance to its enclosure +} +00:24:48 Olivier Leroy: https://deepr.gagolewski.com/chapter/330-environment.html +00:29:43 Olivier Leroy: Btw I do not understand what using random order speed up the search (I will learn it someday) +00:29:49 Olivier Leroy: why* +00:32:31 Olivier Leroy: This also help understanding some “name conflicts” order +00:32:42 Derek Sollberger (he/him): Reacted to "This also help under..." with 👍 +00:33:16 Steffi LaZerte (she/her): Reacted to "This also help under..." with 👍 +00:35:20 Jo Hardin: but what you are showing is where the function *lives* right? doesn’t the function still have its own environment? +00:35:45 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +I think only when it's run... +00:36:09 Olivier Leroy: Replying to "but what you are sho..." + +Yes where it lives +00:36:10 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +I think there are three things: +00:36:11 Tinashe Tapera: Just want to include a comment: the knowledge of path searching is very useful for when you’re debugging things on your computer in general. If ever something goes wrong, look at your path in the terminal + +echo $PATH +00:36:21 Olivier Leroy: Reacted to "Just want to include..." with 👍 +00:36:27 Derek Sollberger (he/him): Reacted to "Just want to include..." with 👍 +00:36:28 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +Where it lives, where it looks for variables, and it's environment when it runs +00:36:46 Jo Hardin: Reacted to "Where it lives, wher..." with 👍 +00:37:10 Olivier Leroy: Reacted to "Where it lives, wher..." with 👍 +00:37:57 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +"The distinction between binding and being bound by is subtle but important; the difference is how we find g versus how g finds its variables." +00:38:03 Jo Hardin: Replying to "but what you are sho..." + +doesn’t it look for variables in “its environment” ? i don’t understand the different between Steffi’s last two. +00:39:01 Jo Hardin: Replying to "but what you are sho..." + +but it always looks inside the function first because that is “the function’s environment”… and then it just keeps going up the parent chain? +00:39:09 Steffi LaZerte (she/her): Reacted to "but it always looks ..." with 👍🏻 +00:39:24 Jo Hardin: Replying to "but what you are sho..." + +doesn’t really matter whether the parent is global or any other environment, right? +00:39:35 Jo Hardin: Reacted to ""The distinction bet..." with ❤️ +00:41:33 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +I think there is a difference if it's a function you create in the global vs. one in a package environment +00:41:49 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +because package functions won't use variables in your global environment +00:42:09 Jo Hardin: Replying to "but what you are sho..." + +well, that’s because functions in packages don’t have global as a parent. right? +00:42:25 Steffi LaZerte (she/her): Replying to "but what you are sho..." + +Hmmm... that's a good point! +00:42:45 Steffi LaZerte (she/her): Reacted to "Just want to include..." with 👍 +00:43:58 Jo Hardin: can you copy and paste your code into the chat? i’d love to play with it! +00:46:32 Olivier Leroy: ei$a +00:49:07 Diana Garcia Cortes: g <- "hello" + +e1 <- env( + g = 10, + a = 78 +) + +e1$funcion_in_e1 <- function(x = a) { + print(x) + g +} + +fn_env(e1$funcion_in_e1) +e1$funcion_in_e1(e1$a) +00:49:36 Jo Hardin: Replying to "g <- "hello" + +e1 <- ..." + +thank you! +00:49:41 Olivier Leroy: Reacted to "g <- "hello" + +e1 <- ..." with 👍 +00:49:54 Derek Sollberger (he/him): Reacted to "g <- "hello" + +e1 <- ..." with 😻 +00:50:40 Olivier Leroy: It matter for us but not for the package namepace +00:58:54 Olivier Leroy: I am so bad with reading “!” +01:03:35 Jo Hardin: Really great, thank you! +01:05:04 Jo Hardin: i teach, so i like getting as much done before the semester starts. +01:05:21 Derek Sollberger (he/him): Reacted to "i teach, so i like g..." with 💯 +01:05:46 Diana Garcia Cortes: Reacted to "Just want to include..." with 👍 +01:05:54 Jo Hardin: thanks everyone. see you next week. +01:05:58 Tinashe Tapera: Good job everybody +01:06:04 Tinashe Tapera: See you next time +01:06:08 Olivier Leroy: End +``` +</details> diff --git a/videos/08/08.qmd b/videos/08/08.qmd @@ -0,0 +1,19 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/i3Uw6nJT-Hk >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:11:57 Federica (she/her): start +00:23:34 Federica (she/her): http://adv-r.had.co.nz/beyond-exception-handling.html +00:23:47 Federica (she/her): https://style.tidyverse.org/error-messages.html +00:26:33 Betsy: no, can't hear the rain at all! +01:07:31 Rebecca Butler: record_log(log("Hello"), path = here::here("mylog.txt")) +01:11:11 Federica (she/her): stop +01:12:38 Rebecca Butler: I have a meeting now and need to run. Thanks for the presentation today! +``` +</details> diff --git a/videos/08/09.qmd b/videos/08/09.qmd @@ -0,0 +1,102 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/IcYVNhpoB3w >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:05:48 Jeffrey Stevens: I"ve never understood tryCatch() +00:09:29 Jo Hardin: you are a great facilitator, Olivier! +00:09:34 Olivier Leroy: start +00:09:41 Jeffrey Stevens: Reacted to "you are a great faci..." with 💯 +00:10:09 Diana Garcia Cortes: Reacted to "you are a great faci..." with 💯 +00:12:59 Leo: Reacted to "you are a great faci..." with 🎉 +00:15:12 Howard Baek: https://style.tidyverse.org/error-messages.html +00:15:29 Olivier Leroy: The stop function take … as arguments +00:17:48 Olivier Leroy: I had a “how now I understand why warning are staking moment reading that part” +00:21:10 Diana Garcia Cortes: https://statisticsglobe.com/errors-warnings-r +00:29:42 Olivier Leroy: I use message to return side effect like “where the file is downloaded” even if you can hide that in other pLACE +00:31:52 Steffi LaZerte (she/her): Sorry I'm late! +00:32:18 Jeffrey Stevens: Reacted to "Sorry I'm late!" with 👋 +00:32:28 Olivier Leroy: Replying to "Sorry I'm late!" + +No worries welcome! +00:32:30 Diana Garcia Cortes: From the ComplexHeatmap package from Bioconductor: + +library(ComplexHeatmap) +Loading required package: grid +======================================== +ComplexHeatmap version 2.18.0 +Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/ +Github page: https://github.com/jokergoo/ComplexHeatmap +Documentation: http://jokergoo.github.io/ComplexHeatmap-reference + +If you use it in published research, please cite either one: +- Gu, Z. Complex Heatmap Visualization. iMeta 2022. +- Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional + genomic data. Bioinformatics 2016. + + +The new InteractiveComplexHeatmap package can directly export static +complex heatmaps into an interactive Shiny app with zero effort. Have a try! + +This message can be suppressed by: + suppressPackageStartupMessages(library(ComplexHeatmap)) +======================================== +00:32:50 Olivier Leroy: Reacted to "From the ComplexHeat..." with 👻 +00:33:08 Jeffrey Stevens: Reacted to "From the ComplexHeat..." with 😱 +00:33:52 Olivier Leroy: Reacted to "Sorry I'm late!" with 👋 +00:34:36 Olivier Leroy: Just new line +00:35:45 Olivier Leroy: That is how you can create nice message in ComplexHeatmap 🙂 +00:35:59 Jeffrey Stevens: What's the difference between cat() and print()? +00:36:17 Steffi LaZerte (she/her): Reacted to "No worries welcome!" with 😅 +00:37:08 Jeffrey Stevens: print() is creating a vector? +00:38:24 Diana Garcia Cortes: Print receives an object as an argument, cat has … +00:38:37 Jeffrey Stevens: OK, thanks +00:38:56 Howard Baek: https://stackoverflow.com/questions/31843662/what-is-the-difference-between-cat-and-print +00:40:40 Diana Garcia Cortes: I’ll start using message() instead of cat() to tell myself what I’m doing in my own code 😆 +00:41:11 Olivier Leroy: Replying to "I’ll start using mes..." + +I am an huge print user also 😛 +00:41:28 Diana Garcia Cortes: Reacted to "I am an huge print u..." with 😃 +00:41:30 Steffi LaZerte (she/her): Message is much nicer to handle, I find. I use cat() if I'm print text that I need to copy/paste elsewhere +00:41:36 Olivier Leroy: Reacted to "I’ll start using mes..." with ✊ +00:42:26 Diana Garcia Cortes: Reacted to "Message is much nice..." with 😮 +00:42:42 Steffi LaZerte (she/her): Another difference between cat and print is that cat will 'print' the line breaks appropriately: + +> print("hi\neveryone") +[1] "hi\neveryone" +> cat("hi\neveryone") +hi +everyone +> +00:42:56 Olivier Leroy: Reacted to "Another difference b..." with 👍 +00:44:53 Diana Garcia Cortes: Reacted to "Another difference b..." with 👍 +00:46:10 Steffi LaZerte (she/her): I've always used what they don't recommend here, using try() and checking the class for "try-error" rather than using tryCatch() because I could never understand how to use tryCatch() 😅 + +I'm looking forward to figuring this out! +00:46:32 Jeffrey Stevens: Reacted to "I've always used wha..." with 💯 +00:49:34 Olivier Leroy: Add a print so we had to path to check 😛 +00:50:25 Steffi LaZerte (she/her): Reacted to "Add a print so we ha..." with 🤣 +00:51:38 Jo Hardin: i totally agree Olivier. seems like it’s very hard to understand the `tryCatch()` flow. +00:54:19 Jo Hardin: it makes me think a little bit about the logic / flow of the arguments in `ifelse()` or `case_when()`. +00:54:52 Diana Garcia Cortes: rows <- tryCatch({ + vroom(snakemake@params[["row_filter_file"]], delim = "\t") %>% + clean_names() %>% pull(1) +}, error = function(e) { + print("No row filter file found") + NULL + message(“No row filter file found") + +}) +01:03:04 Jeffrey Stevens: I'm surprised the chapter didn't reference the {cli} package. Do you all use it? +https://cli.r-lib.org/index.html +01:03:54 Jeffrey Stevens: Beautiful messaging +01:04:20 Steffi LaZerte (she/her): Reacted to "rows <- tryCatch({ + ..." with 💯 +01:04:57 Olivier Leroy: End +``` +</details> diff --git a/videos/09/08.qmd b/videos/09/08.qmd @@ -0,0 +1,5 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/Gn5XKyQv710 >}} diff --git a/videos/09/09.qmd b/videos/09/09.qmd @@ -0,0 +1,120 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/9LO7hZVB6qY >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:03:07 Olivier Leroy: Vintage dessert recipe +00:04:46 Olivier Leroy: https://tenmorebites.com/2015/09/26/skunk/ +00:07:34 Olivier Leroy: https://en.wikipedia.org/wiki/Ambrosia_(fruit_salad) +00:10:37 Olivier Leroy: start +00:12:27 Olivier Leroy: In my mind a list is a recursive vector +00:13:41 Steffi LaZerte (she/her): "Vectors come in two flavours: atomic vectors and lists" Chp 3 Introduction +00:13:49 Olivier Leroy: Reacted to ""Vectors come in two..." with 👍 +00:13:55 Gabby Palomo Munoz: Reacted to ""Vectors come in two..." with 💯 +00:14:32 Gabby Palomo Munoz: There's also map_dfr or something? I think it's deprecated but it's still there... right? +00:14:58 Jeffrey Stevens: Replying to "There's also map_dfr..." + +I think it is superceded rather than deprecated. +00:15:19 Gabby Palomo Munoz: Replying to "There's also map_dfr..." + +@Jeffrey Stevens what's the difference? +00:15:44 Jeffrey Stevens: Replying to "There's also map_dfr..." + +Deprecated will eventually go away. Superceded is maintained but there is a betterr way to do it. +00:15:46 Steffi LaZerte (she/her): Replying to "There's also map_dfr..." + +Yes, but as you said, not recommended because it is confusing as it implies it acts like map_lgl etc., but it doesn't. I've never really understood it 😅 +00:15:59 Gabby Palomo Munoz: Reacted to "Deprecated will even..." with 😍 +00:16:18 Derek Sollberger (he/him): Reacted to "Deprecated will even..." with 😍 +00:16:58 Gabby Palomo Munoz: Reacted to "Yes, but as you said..." with 👍🏻 +00:17:55 Steffi LaZerte (she/her): I was so happy to learn that ~ is pronounced "twiddle" that I ran into my spouses office to share 😂 +00:18:06 Olivier Leroy: Tilda also +00:18:24 Jeffrey Stevens: Reacted to "I was so happy to le..." with ➕ +00:18:34 Derek Sollberger (he/him): Reacted to "I was so happy to le..." with ➕ +00:19:56 Steffi LaZerte (she/her): However, using the ... is now not encouraged (map gives you a message/warning if you do, I think) +00:20:00 Olivier Leroy: I am not an huge fan of the formula syntax, it use a lot of metaprogramming to works and I am always afraid I misunderstood it +00:20:43 Olivier Leroy: I used that anonymous function a lot” (length(unique(x))) +00:22:02 Steffi LaZerte (she/her): I really like the new R anonymous syntax: \(x) length(unique(x)) Still compact, but allows you to set your own argument names +00:22:38 Olivier Leroy: Reacted to "I really like the ne..." with 👍 +00:22:47 Gabby Palomo Munoz: Replying to "I really like the ne..." + +All of this is so confusing to me because is it function(x), ~, or \(x) +00:22:55 Gabby Palomo Munoz: Replying to "I really like the ne..." + +Too many ways to say the same thing. I get confused. +00:23:04 Derek Sollberger (he/him): Reacted to "All of this is so co..." with 👍 +00:23:34 Steffi LaZerte (she/her): Replying to "I really like the ne..." + +They are all equivalent, with the exception of in ~ you have to use the built-in argument names, in function(x) or \(x) you choose the argument name. I.e. you can say function(my_arg) or \(my_arg) for example. +00:25:06 Jeffrey Stevens: I was very happy to see the explanation of . vs .x vs ..1 +00:25:25 Gabby Palomo Munoz: Replying to "I was very happy to ..." + +They just lost me with ..1 +00:25:30 Olivier Leroy: Reacted to "I was very happy to ..." with 👍 +00:25:59 Olivier Leroy: Here is “.” Is the place holder ? +00:26:02 Jeffrey Stevens: Replying to "I was very happy to ..." + +. is for one argument +.x and .y are for two arguments +..1, ..2, ..3 etc are for more arguments +00:26:03 Olivier Leroy: unsure +00:26:09 Steffi LaZerte (she/her): Replying to "I was very happy to ..." + +It's a way of referring to the arguments by position, when you might have up to n arguments. It's much more relevant with the pmap family. +00:26:25 Steffi LaZerte (she/her): Replying to "I was very happy to ..." + +..1, ..2, ..., ..n +00:27:09 Steffi LaZerte (she/her): Replying to "Here is “.” Is the p..." + +. is the argument 😅 +00:27:51 Olivier Leroy: Replying to "Here is “.” Is the p..." + +Ouch +00:28:48 Olivier Leroy: Good trial/error! +00:28:52 Steffi LaZerte (she/her): Replying to "Here is “.” Is the p..." + +Which is why we shouldn't use it... So confusing! +00:28:58 Jeffrey Stevens: Reacted to "Good trial/error!" with ➕ +00:29:02 Steffi LaZerte (she/her): Reacted to "Good trial/error!" with ➕ +00:33:14 Steffi LaZerte (she/her): I use map() all the time, but had never heard of modify(), I'm so happy! I think I can use that a lot in future. +00:33:27 Olivier Leroy: One quick point purrr::map is diff than base::Map +00:33:45 Steffi LaZerte (she/her): Reacted to "One quick point purr..." with 👍🏻 +00:36:14 Olivier Leroy: powering +00:37:25 Olivier Leroy: I did not about this one and will prob use it +00:38:43 Steffi LaZerte (she/her): There is the furrr package which impliments parallized purrr functions +00:41:33 Steffi LaZerte (she/her): Messages prove that it worked 😉 +00:43:36 Olivier Leroy: Useful in simulation (sadly I am not doing much of that now ..) +00:44:10 Steffi LaZerte (she/her): I saw this usage of pmap in a conference presentation last year and it totally blew my mind 🤯 +00:44:20 Olivier Leroy: Reacted to "I saw this usage of ..." with 👍 +00:44:26 Olivier Leroy: Replying to "I saw this usage of ..." + +Still blew mine +00:44:32 Steffi LaZerte (she/her): Reacted to "Still blew mine" with 😂 +00:48:22 Steffi LaZerte (she/her): Another function that I can totally see me using that I had no idea about!!! So exciting 😁 +00:52:44 Olivier Leroy: I will be so lost between decimal . and .. (zoom is also lost and want to capitalize after .) +00:53:03 Steffi LaZerte (she/her): ggplot(mtcars, aes(hp, mpg)) + + reduce2(c(8,4,2), ...) +00:53:41 Derek Sollberger (he/him): aside: Maelle Salmon blog post with an example of `reduce` +https://masalmon.eu/2023/07/26/reduce/ +00:53:48 Olivier Leroy: Reacted to "aside: Maelle Salmon..." with 👍 +00:56:24 Olivier Leroy: Go back in time Hadley! +00:56:25 Steffi LaZerte (she/her): Reacted to "aside: Maelle Salmon..." with 👍🏻 +00:56:30 Jeffrey Stevens: Reacted to "Go back in time Hadl..." with ➕ +00:58:59 Steffi LaZerte (she/her): Reacted to "Go back in time Hadl..." with 😂 +01:00:20 Olivier Leroy: This will look better as prettify json +01:01:03 Derek Sollberger (he/him): (about `pluck`) Other programming languages, such as LISP, 'pop' elements out of an array instead of viewing elements +01:03:24 Steffi LaZerte (she/her): Reacted to "(about `pluck`) Othe..." with 👍🏻 +01:03:37 Olivier Leroy: Reacted to "(about `pluck`) Othe..." with 👍 +01:05:47 Derek Sollberger (he/him): Thank you! I am still new to functional programming in R, and this was very helpful :-) +01:05:52 Jeffrey Stevens: Great job, Jo! This was very informative! +01:06:01 Steffi LaZerte (she/her): Super great thanks +01:06:02 Steffi LaZerte (she/her): ! +01:06:10 Steffi LaZerte (she/her): wonderful discussions! +01:06:12 Olivier Leroy: End +``` +</details> diff --git a/videos/10/08.qmd b/videos/10/08.qmd @@ -0,0 +1,5 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/FJGqfqdb3zA >}} diff --git a/videos/10/09.qmd b/videos/10/09.qmd @@ -0,0 +1,76 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/Kxjw_nXmDVY >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:12:04 Olivier Leroy: Start +00:12:36 Olivier Leroy: Great! +00:16:21 Olivier Leroy: I also searched other examples I find some here: https://raps-with-r.dev/fprog.html#writing-good-functions (still unclear where/when for me) +00:17:24 Derek Sollberger (he/him): Reacted to "I also searched othe..." with 👍 +00:17:57 Jo Hardin: is “binding” like “names" +00:20:03 Olivier Leroy: (Did not about it also) +00:20:07 Olivier Leroy: know +00:21:15 Olivier Leroy: Good point +00:22:53 Jeff Stevens: Mind blown! So glad you mentioned that. +00:23:19 Olivier Leroy: Replying to "is “binding” like “n..." + +About binding and name I like https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-10.html#%_sec_1.1.2 (disclaimer I never only read 2 chapter of it) +00:23:28 Olivier Leroy: Reacted to "Mind blown! So glad ..." with 👍 +00:26:33 Olivier Leroy: I think I understood the super assignment as “write in global” for a long time +00:26:47 Jeff Stevens: Replying to "I think I understood..." + +Me too +00:26:53 Derek Sollberger (he/him): Reacted to "I think I understood..." with 👍 +00:26:58 Howard Baek: Reacted to "I think I understood..." with 👍 +00:27:12 Jeff Stevens: Reacted to "I think I understood..." with 👍 +00:30:25 Tinashe Tapera: So does R have a global assignment at all? +00:31:02 Tinashe Tapera: I’m sure it should out of software architecture mecessity +00:31:22 Olivier Leroy: Replying to "So does R have a glo..." + +No idea, if I want to force it I will assign to .globalenv +00:32:17 Tinashe Tapera: Reacted to "No idea, if I want t…" with 👌 +00:32:21 Olivier Leroy: assign(x, env = .gloabenv) +00:32:22 Derek Sollberger (he/him): Replying to "So does R have a glo..." + +Yes, it looks like `assign()` has an `envir` parameter + +https://stackoverflow.com/questions/9726705/assign-multiple-objects-to-globalenv-from-within-a-function +00:32:52 Olivier Leroy: Wrong spelling in .globalenv +00:33:52 Derek Sollberger (he/him): sounds like a Data Mishaps Night story :-) +00:34:11 Olivier Leroy: Reacted to "sounds like a Data M..." with 👻 +00:34:27 Jeff Stevens: Should we be doing garbage collection on all functions (not just function factories) to save memory? +00:34:36 Olivier Leroy: I did not know that! +00:35:47 Jeff Stevens: Awesome explanation--thanks! +00:35:52 Olivier Leroy: Reacted to "Awesome explanation-..." with 👍 +00:36:24 Olivier Leroy: Or you cache outside and kill R +00:36:37 Tinashe Tapera: Use targets +00:36:46 Tinashe Tapera: That’s exactly what targets is for +00:36:55 Olivier Leroy: Reacted to "That’s exactly what ..." with 👍 +00:36:57 Derek Sollberger (he/him): Reacted to "That’s exactly what ..." with 😻 +00:38:36 Olivier Leroy: -> https://wlandau.github.io/targetopia/contributing.html#target-factories + +(Good example) +00:43:10 Jo Hardin: i’m excited about the `switch()` function you just showed! +00:43:23 Olivier Leroy: Declarative is always nice on readability! +00:51:26 Olivier Leroy: Yes very elegant to store stuff +00:51:55 Derek Sollberger (he/him): all 5 functions in `funs` start with the same environment? +00:52:15 Olivier Leroy: Replying to "all 5 functions in `..." + +Good question +00:53:30 Olivier Leroy: It seems attach can attach any kind of object that can be tricky +00:54:04 Derek Sollberger (he/him): Replying to "all 5 functions in `..." + +ah (I read too fast) +00:56:02 Olivier Leroy: I use the ecdf one, not that frequently +00:59:35 Tinashe Tapera: You’re justified in hating setwd() though +00:59:47 Steffi LaZerte (she/her): Reacted to "You’re justified in ..." with 😂 +01:00:23 Derek Sollberger (he/him): I doubt that I have seen any other book cover functional programming before OOP (and thank you for the walkthrough) +01:03:50 Diana Garcia Cortes: Thank you Steffi! +01:03:56 Olivier Leroy: end +``` +</details> diff --git a/videos/11/08.qmd b/videos/11/08.qmd @@ -0,0 +1,5 @@ +--- +title: Cohort 8 +--- + +{{< video https://www.youtube.com/embed/dT7Npl9DNIY >}} diff --git a/videos/11/09.qmd b/videos/11/09.qmd @@ -0,0 +1,19 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/JL95tLWS0XI >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:11:21 Derek Sollberger: The webR extension for Quarto is neat! +00:12:53 Derek Sollberger: Make "Base Types" mandatory reading on our own? +00:17:28 Derek Sollberger: start +00:35:23 Steffi LaZerte (she/her): auto_browser looks pretty cool! +00:44:13 Steffi LaZerte (she/her): Wow that Vectorize looks pretty useful +01:11:08 Olivier Leroy: stop +01:11:10 Olivier Leroy: end +``` +</details> diff --git a/videos/12/09.qmd b/videos/12/09.qmd @@ -0,0 +1,43 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/6yW9dlErLv0 >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:08:26 Olivier Leroy: Start +00:11:23 Olivier Leroy: Yeah unsure that s3 count as OOP it really def or your def of OOP 😛 +00:12:57 Olivier Leroy: Is S still in dev. ? +00:14:53 Jeffrey Stevens: From Wikipedia: +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. +00:15:20 Derek Sollberger (he/him): "S7 = S3 + S4 +00:15:28 Diana Garcia Cortes: Reacted to ""S7 = S3 + S4" with 😂 +00:15:36 Olivier Leroy: Reacted to ""S7 = S3 + S4" with 😂 +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/) +00:21:05 Jeffrey Stevens: "S-PLUS 7.0 released in 2005" (https://en.wikipedia.org/wiki/S-PLUS) +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) +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 +00:22:38 Olivier Leroy: Reacted to "I guess we got an ex..." with 👍 +00:24:51 Diana Garcia Cortes: Reacted to "Inheritance is weird..." with 👍 +00:27:08 Olivier Leroy: The sf packages use s3 a lot +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 +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) +00:40:24 Diana Garcia Cortes: Reacted to "One stuff that bothe..." with 😯 +00:41:42 Olivier Leroy: typeof(as.raw(0x0f)) also ... +00:46:55 Olivier Leroy: > ‘as.numeric’ is a generic function, but S3 methods must be written + for ‘as.double’. It is identical to ‘as.double’. +00:46:59 Olivier Leroy: From the doc 😛 +00:49:09 Olivier Leroy: Isn’t it because is.nuneric on class factor is diffrent? +00:50:34 Jeffrey Stevens: Why does is.integer(typeof(factor("x"))) show up as false? +00:51:06 Olivier Leroy: "Integer” +00:51:20 Diana Garcia Cortes: typeof(...) +00:51:36 Diana Garcia Cortes: > typeof(...) +Error: '...' used in an incorrect context +> typeof(`...`) +Error: '...' used in an incorrect context +00:52:56 Olivier Leroy: End +``` +</details> diff --git a/videos/13/09.qmd b/videos/13/09.qmd @@ -0,0 +1,63 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/4_hYWHOMM3k >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:06:56 Jeffrey Stevens: Which book? +00:07:03 Olivier Leroy: SICP +00:07:21 Olivier Leroy: https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs +00:10:27 Olivier Leroy: Start +00:14:35 Olivier Leroy: More if you came from python +00:24:13 Derek Sollberger: possible example: US high school is grades 9:12, but a factor variable wants to also define grades 1:8 as well +00:26:21 Diana Garcia Cortes: x <- factor(10:20) +> unclass(x) + [1] 1 2 3 4 5 6 7 8 9 10 11 +attr(,"levels") + [1] "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" +00:26:52 Jo Hardin: what do you get with max(unclass(x)) +00:27:25 Olivier Leroy: r$> max(unclass(x)) +[1] 11 +00:28:49 Olivier Leroy: r$> unclass(10:12) +[1] 10 11 12 +00:31:00 Jeffrey Stevens: "The constructor is a developer function: it will be called in many places, by an experienced user. That means it’s OK to trade a little safety in return for performance, and you should avoid potentially time-consuming checks in the constructor." +00:33:53 Derek Sollberger: # Simpsons reference +> as.roman(5) + as.roman(2) +[1] VII +00:48:27 Olivier Leroy: r$> g <- function(x) {x <- 10; y<- 10 ;UseMethod("g")} + +r$> g() +Error in UseMethod("g") : + no applicable method for 'g' applied to an object of class "NULL" +00:48:50 Derek Sollberger: Replying to "# Simpsons reference..." + +> # group generics example +> 5 + as.roman(2) +[1] VII +00:51:34 Derek Sollberger: Replying to "r$> g <- function(x)..." + +> g <- function(x) { ++ x <- 10 ++ y <- 10 ++ UseMethod("g") ++ } +> sloop::s3_methods_generic("g") +# A tibble: 0 × 4 +# ℹ️ 4 variables: generic <chr>, class <chr>, +# visible <lgl>, source <chr> +> g.default <- function(x) c(x = x, y = y) +> sloop::s3_methods_generic("g") +# A tibble: 1 × 4 + generic class visible source + <chr> <chr> <lgl> <chr> +1 g default TRUE .GlobalEnv +00:51:53 Olivier Leroy: Reacted to "> g <- function(x) {..." with 👍 +00:52:05 Diana Garcia Cortes: Reacted to "> g <- function(x) {..." with 👍 +01:06:12 Diana Garcia Cortes: I guess we can say that polymorphism is implemented in R relying on methods correctly named and an mistery UseMethod() function +01:06:45 Olivier Leroy: end +``` +</details> diff --git a/videos/14/09.qmd b/videos/14/09.qmd @@ -0,0 +1,37 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/IUPx9q4vJrY >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:12:52 Olivier Leroy: Start +00:17:30 Olivier Leroy: my_table$my_field +00:29:14 Olivier Leroy: (Save in project! Or I will callJenny!) +00:30:42 Derek Sollberger: If I run "collinsavings$balance <- 1234", I don't get an error?? +00:32:03 Derek Sollberger: Reacted to "(Save in project! Or..." with 🔥 +00:33:12 Steffi LaZerte (she/her): I don't think you should? +00:36:27 Derek Sollberger: Replying to "I don't think you sh..." + +Right. I thought that the overall question was whether or not we could use the assignment operator +00:38:53 Olivier Leroy: My understanding is that myniceprint and mybankaccount has two different enclosing +00:40:21 Olivier Leroy: Yup states are so hard to manage! +00:40:37 Olivier Leroy: Environment > states 😛 +00:47:41 Jeffrey Stevens: F10 +00:50:22 Olivier Leroy: I would like copilot to use billionaire name instead of John +00:51:25 Olivier Leroy: I am already bad at copy pasting, I would be really bad with co pilot +00:54:36 Olivier Leroy: Using just names to get the list of method is really nice versus S3 +00:57:38 Derek Sollberger: aside: this `ids` package looks to ben convenient for creating fake practice data + +https://cran.r-project.org/web/packages/ids/vignettes/ids.html +00:57:39 Olivier Leroy: It is just increasing an an ids +01:00:49 Jo Hardin: I need to take off for another meeting. Great job @Diana Garcia Cortes !!! Nice shirt @Jeffrey Stevens . 🙂 See you all next week. +01:01:29 Olivier Leroy: Reacted to "I need to take off f..." with 😄 +01:01:57 Olivier Leroy: Good example +01:03:23 Olivier Leroy: Yup tricky on tempfile() / tempdir() +01:06:32 Olivier Leroy: End +``` +</details> diff --git a/videos/15/09.qmd b/videos/15/09.qmd @@ -0,0 +1,32 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/fEmj1YI3A9M >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:06:42 Olivier Leroy: https://github.com/ropensci/quadkeyr +00:07:53 Olivier Leroy: https://github.com/teamookla +00:12:58 Olivier Leroy: start +00:14:09 Olivier Leroy: https://github.com/edzer/sp +00:15:16 Derek Sollberger: I just used `lubridate` to compute the ages of Olympian athletes :-) +00:15:27 Steffi LaZerte (she/her): Reacted to "I just used `lubrida..." with 🎉 +00:20:09 Jo Hardin: Reacted to "I just used `lubrida..." with 🎉 +00:22:18 Steffi LaZerte (she/her): Or -Age :D +00:23:04 Derek Sollberger: > class(Inf) +[1] "numeric" +> typeof(Inf) +[1] "double" +> sloop::otype(Inf) +[1] "base" +00:32:11 Derek Sollberger: That's an incredibly useful search tool! +00:34:57 Derek Sollberger: Replying to "That's an incredibly..." + +(example for chat) search "memes language:R" in GitHub +00:38:34 Steffi LaZerte (she/her): Reacted to "(example for chat) s..." with 😂 +01:01:46 Olivier Leroy: End +``` +</details> diff --git a/videos/16/09.qmd b/videos/16/09.qmd @@ -0,0 +1,42 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/QMnk6ianL10 >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:09:36 Olivier Leroy: Start +00:17:56 Steffi LaZerte (she/her): I always appreciate these discussions! +00:18:05 Diana Garcia Cortes: Reacted to "I always appreciate ..." with ❤️ +00:18:31 Steffi LaZerte (she/her): Invariably I always think I know the answer and find out that it's not quite as simple as I originally thought, so super valuable. +00:18:38 Jo Hardin: Reacted to "I always appreciate ..." with ❤️ +00:19:51 Olivier Leroy: Closure has plenty polymorphism https://clojure-doc.org/articles/language/polymorphism/ +00:22:57 Olivier Leroy: Let’s bring back R retro computing +00:23:03 Steffi LaZerte (she/her): Reacted to "Let’s bring back R r..." with 😂 +00:29:56 Olivier Leroy: https://linuxize.com/post/popd-and-pushd-commands-in-linux/ +00:32:22 Diana Garcia Cortes: I like the wiki stack illustration: https://en.wikipedia.org/wiki/Stack_(abstract_data_type) +00:33:33 Derek Sollberger (he/him): Reacted to "I like the wiki stac..." with 🥞 +00:33:51 Steffi LaZerte (she/her): I cheated: I skimmed and decided that I didn't need to really understand the nuances at this point. I'll come back when I do 😅 +00:34:02 Olivier Leroy: Reacted to "I like the wiki stac..." with 🥞 +00:34:11 Olivier Leroy: Reacted to "I cheated: I skimmed..." with 👍 +00:36:58 Olivier Leroy: Great point +00:38:22 Steffi LaZerte (she/her): I love that analogy 😁 +00:39:28 Derek Sollberger (he/him): Replying to "I love that analogy ..." + +(for our records) +S3 --> S7 … RMD --> QMD +00:40:44 Steffi LaZerte (she/her): Reacted to "(for our records) +S3..." with 🙏🏻 +00:41:48 Olivier Leroy: The @ sign is for print? +00:47:01 Olivier Leroy: Can u use str(cat) +00:51:18 Olivier Leroy: Reacted to "(As if we were in a ..." with 😄 +00:59:34 Jo Hardin: the summary is super helpful! +00:59:48 Olivier Leroy: Reacted to "the summary is super..." with 👍 +00:59:50 Diana Garcia Cortes: Reacted to "the summary is super..." with 👍 +01:00:08 Derek Sollberger (he/him): Reacted to "the summary is super..." with 👍 +01:00:57 Olivier Leroy: end +``` +</details> diff --git a/videos/17/09.qmd b/videos/17/09.qmd @@ -0,0 +1,32 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/Nah3PeBzFnw >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:09:33 Steffi LaZerte (she/her): start +00:12:36 Olivier Leroy: I have a very bad connection sorry for being late +00:15:06 Olivier Leroy: Here get(“means”) return a function that got passed c() +00:19:45 Olivier Leroy: No worries 😛 +00:21:48 Olivier Leroy: They are not evaluated +00:25:25 Olivier Leroy: Maybe data mask example would help here and !! Is used when you want to interact with tidyverse +00:26:55 Olivier Leroy: And this is an example of metaprogramming +00:27:15 Olivier Leroy: (Very good job Steffi) +00:28:00 Jeffrey Stevens: @Jo: "One of the most intriguing things about R is its ability to do metaprogramming. This is the idea that code is data that can be inspected and modified programmatically." +00:28:42 Jo Hardin: Reacted to "@Jo: "One of the mos..." with 👍 +00:29:05 Olivier Leroy: (Also we are going to spend 4 more chapters on those concepts so it is fine if they do not get understand right away) +00:31:33 Olivier Leroy: The SQL example was very good +00:49:05 Olivier Leroy: No it is created in the call of the function? +00:53:55 Olivier Leroy: Thanks you Steffi! +00:57:54 Olivier Leroy: I was mostly disconnected, but we will do more of it latter +00:59:34 Derek Sollberger (he/him): Steffi: these additional `with2` examples would be great on the slides (for future cohorts) :-) +01:00:52 Olivier Leroy: Reacted to "Steffi: these additi..." with 👍 +01:02:35 Steffi LaZerte (she/her): end +01:02:36 Olivier Leroy: Yes please +01:02:49 Olivier Leroy: Yes Jo is next +``` +</details> diff --git a/videos/18/09.qmd b/videos/18/09.qmd @@ -0,0 +1,42 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/HdCl_znaQLs >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:10:06 Steffi LaZerte (she/her): https://steffilazerte.ca/posts/ggplot-symbols/ +00:10:53 Olivier Leroy: start +00:26:46 Derek Sollberger: In math, this would be "function composition" +00:26:55 Steffi LaZerte (she/her): Reacted to "In math, this would ..." with 👍🏻 +00:28:18 Derek Sollberger: Aside: this "infix" style dates back to some Polish(?) mathematicians, and may have a resurgence for some artificial intelligence algorithms +00:31:27 Olivier Leroy: (+ 1 2 3) +00:31:38 Olivier Leroy: () +00:36:13 Derek Sollberger: sym("x") is useful if you want R to do your Calculus homework for you, haha +00:36:21 Steffi LaZerte (she/her): Reacted to "sym("x") is useful i..." with 😂 +00:36:49 Olivier Leroy: “Bob” is contant bob <- 1 is a symbol no ? +00:37:06 Steffi LaZerte (she/her): Reacted to "“Bob” is contant bob..." with 👍🏻 +00:38:38 Steffi LaZerte (she/her): Actually possibly not? +x <- 1 +is.symbol(x) # FALSE +is.symbol(expr(x)) # TRUE +00:39:59 Olivier Leroy: square( 2 + 3) +00:40:35 Derek Sollberger: Reacted to "Actually possibly no..." with 👍 +00:46:19 Steffi LaZerte (she/her): Ah! Because it's just the x part that is the symbol, not the whole expression 😁 +00:57:34 Olivier Leroy: `(` +01:02:40 Jeffrey Stevens: Got to go. See everyone next week. Thanks, Jo! +01:02:43 Steffi LaZerte (she/her): PEMDAS! For me it was BEDMAS! :D +01:03:11 Derek Sollberger: Reacted to "PEMDAS! For me it wa..." with 👍 +01:03:29 Nagarjun: Replying to "PEMDAS! For me it ..." + +BODMAS for us in Asia +01:03:39 Steffi LaZerte (she/her): Reacted to "BODMAS for us in Asi..." with ❤️ +01:03:50 Steffi LaZerte (she/her): Replying to "PEMDAS! For me it wa..." + + (probably why I use "brackets" rather than "parentheses") +01:03:55 Olivier Leroy: end +``` +</details> diff --git a/videos/19/09.qmd b/videos/19/09.qmd @@ -0,0 +1,40 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/p23VJfhi8OQ >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:06:42 Olivier Leroy: start +00:07:15 Olivier Leroy: I already appreciate it! +00:13:14 Olivier Leroy: I just noticed the joke …. +00:16:59 Olivier Leroy: Good example! +00:17:23 Olivier Leroy: Very fancy ! +00:19:42 Olivier Leroy: deparse(substitute()) is a classic +00:19:49 Steffi LaZerte (she/her): Reacted to "deparse(substitute()..." with ❤️ +00:22:18 Jeffrey Stevens: Don't forget !!, !!!, parse(), deparse(), eval() +😜 +00:22:29 Steffi LaZerte (she/her): Reacted to "Don't forget !!, !!!..." with 😂 +00:23:51 Olivier Leroy: Reacted to "Don't forget !!, !!!..." with 😂 +00:26:07 Jeffrey Stevens: Thanks for the cheatsheet, Steffi. Here's the link for the chat: https://raw.githubusercontent.com/rstudio/cheatsheets/master/tidyeval.pdf +00:26:12 Olivier Leroy: Reacted to "Thanks for the cheat..." with 👍 +00:27:10 Olivier Leroy: And function are good example here +00:27:29 Olivier Leroy: Function in “math" sense +00:40:14 Olivier Leroy: Repetition help build mental model 🙂 +00:41:59 Olivier Leroy: `$`(mtcars, mpg) +00:42:34 Olivier Leroy: `[[`(mtcars, "mpg") +00:43:51 Olivier Leroy: Too smart for us +00:53:44 Olivier Leroy: {{ vars }} +00:55:19 Olivier Leroy: Python community called := walrus operator, I think it is older (also unsure if it is the same idea) +00:55:30 Derek Sollberger: Reacted to "Python community cal..." with 👍 +00:55:40 Arjun: Reacted to "Python community c..." with 👍 +00:59:45 Derek Sollberger: Thanks for this example! One can then create a function for 'variable inflation factor' quickly :-) +01:00:32 Jo Hardin: thanks Steffi!! gotta run. this was awesome. +01:00:38 Jeffrey Stevens: GTG hope to see you all next week, but I'll be traveling, so not sure +01:00:45 Olivier Leroy: Reacted to "GTG hope to see you ..." with 👍 +01:02:24 Olivier Leroy: End +``` +</details> diff --git a/videos/20/09.qmd b/videos/20/09.qmd @@ -0,0 +1,62 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/70Ep06M3NUk >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:12:20 Olivier Leroy: Start +00:16:18 Olivier Leroy: I have a love/hate relation with sort +00:16:23 Olivier Leroy: source +00:17:36 Steffi LaZerte (she/her): docs for rlang::parse_expr: +These functions parse and transform text into R expressions. This is the first step to interpret or evaluate a piece of R code written by a programmer. +00:17:59 Olivier Leroy: ‘parse()’ returns the parsed but unevaluated expressions in an + ‘expression’, a “list” of ‘call’s. +00:19:40 Olivier Leroy: I have a “daily_year” project for this kind of stuff +00:20:42 Olivier Leroy: You are doing great! +00:32:30 Steffi LaZerte (she/her): eval(rlang::get_expr(q), rlang::get_env(q)) same as +rlang::eval_tidy(q) +00:33:41 Olivier Leroy: Reacted to "eval(rlang::get_expr..." with 👍 +00:34:00 Derek Sollberger: Reacted to "eval(rlang::get_expr..." with 👍 +00:34:30 Olivier Leroy: That was intersting, learning the “mistakes” on the road +00:35:24 Steffi LaZerte (she/her): Definitely! Things like this always help me better understand +00:35:31 Olivier Leroy: Reacted to "Definitely! Things l..." with 👍 +00:42:33 Olivier Leroy: Very clear explanation +00:43:11 Steffi LaZerte (she/her): Sometimes I use .env$x in workflows too, for maximum readibility and clarity :D +00:43:19 Olivier Leroy: Reacted to "Sometimes I use .env..." with 👍 +00:47:42 Olivier Leroy: Just noticed you are using relative row number +00:48:16 Jo Hardin: i noticed the row numbering, too, but i don’t understand it! what is relative row numbering? +00:50:52 Olivier Leroy: Reacted to "i noticed the row nu..." with 👍 +00:59:14 Jo Hardin: {{ variable }} +00:59:42 Derek Sollberger: Replying to "{{ variable }}" + +great for data masks? +00:59:53 Olivier Leroy: Replying to "{{ variable }}" + +{{variable}} +01:00:11 Derek Sollberger: Replying to "{{ variable }}" + +https://dsollbergerquarto.netlify.app/posts/curly_operator/curly_operator +01:00:36 Steffi LaZerte (she/her): https://dplyr.tidyverse.org/articles/programming.html +01:03:27 Steffi LaZerte (she/her): var_summary <- function(data, var) { +data %>% +summarise(n = n(), min = min({{ var }}), max = max({{ var }})) +} +mtcars %>% +group_by(cyl) %>% +var_summary(mpg) +01:04:16 Jo Hardin: library(tidyverse) +my_func <- function(x){ + mtcars |> + select({{x}}) +} + +my_func(wt) +01:05:53 Steffi LaZerte (she/her): Reacted to "library(tidyverse) +m..." with 👍🏻 +01:09:46 Olivier Leroy: end +``` +</details> diff --git a/videos/21/09.qmd b/videos/21/09.qmd @@ -0,0 +1,25 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/REfQOHep_Ok >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:15:14 Olivier Leroy: Start +00:17:21 Steffi: A whisker plot 😂 +00:17:27 Olivier Leroy: Reacted to "A whisker plot 😂 " with 😄 +00:19:28 Olivier Leroy: I did not understand that well but that was not really the goal of the chapter (void tag). +00:21:05 Olivier Leroy: Hadley really not liking paste() +00:26:26 Steffi: dots_partition(!!x) +00:29:31 Olivier Leroy: Apparently list2() do not mind ending with , also but not sure if that matters here +00:30:08 Steffi: Reacted to "Apparently list2() d..." with 👍 +00:34:52 Olivier Leroy: Br is a good example +00:50:27 Olivier Leroy: Overbox is full .. +00:53:28 Olivier Leroy: I bugged on that until I realized that latex probably want to keep ( as text and not as function +00:58:39 Olivier Leroy: Omicron! +01:07:13 Olivier Leroy: end +``` +</details> diff --git a/videos/22/09.qmd b/videos/22/09.qmd @@ -0,0 +1,45 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/498yvFZwPrM >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:13:32 Olivier Leroy: Start +00:15:27 Olivier Leroy: It is also good to change mindset: debugging is fun! +00:17:46 Olivier Leroy: I use DDG +00:18:58 Jo Hardin: no, never +00:20:13 Olivier Leroy: It is always NULL 😛 +00:21:14 Steffi LaZerte (she/her): Reacted to "It is always NULL 😛" with 😁 +00:22:11 Derek Sollberger: still describe the bug(s) to the rubber duck + +https://en.wikipedia.org/wiki/Rubber_duck_debugging +00:22:26 Olivier Leroy: Reacted to "still describe the b..." with 🦆 +00:22:39 Diana Garcia: Reacted to "still describe the b..." with 🦆 +00:22:47 Jo Hardin: the title of her talk is: object of type closure is not subsettable +00:23:06 Olivier Leroy: Reacted to "the title of her tal..." with 👻 +00:23:38 Derek Sollberger: Reacted to "the title of her tal..." with 👻 +00:25:14 Steffi LaZerte (she/her): Replying to "still describe the b..." + +With rOpenSci coworking, we always have a 5min scavenger hunt in the middle ("You have 30s to find something that is round", etc.) We get soooo many different rubber duckies 😁 +00:25:26 Derek Sollberger: Reacted to "With rOpenSci cowork..." with 💜 +00:25:26 Steffi LaZerte (she/her): Reacted to "the title of her tal..." with 😅 +00:26:44 Olivier Leroy: Reacted to "With rOpenSci cowork..." with 😄 +00:37:20 Steffi LaZerte (she/her): This is super helpful, because I've never understood all the nuanced steps within browser(). I just move the browser() statement and rerun 😅 +00:38:09 Steffi LaZerte (she/her): Escape also kicks you out (usually but not always) +00:45:24 Steffi LaZerte (she/her): I'm dual-tasking a bit and was excited that your example walked me through using a breakpoint right when I needed it 😁 +00:47:44 Jeffrey Stevens: Reacted to "I'm dual-tasking a b..." with 😂 +00:51:15 Olivier Leroy: I was searching from scholar article on history of debugger but my googlefu is bad now +01:04:01 Derek Sollberger: I just need the warnings to be in a different color (so that my students stop freaking out) +01:04:09 Olivier Leroy: Reacted to "I just need the warn..." with 😄 +01:04:57 Steffi LaZerte (she/her): Hahaha! Yes, I usually spend some time in the first class explaining the difference between Messages, Warnings and Errors :D to try and get them to relax a bit! +01:06:58 Jo Hardin: gotta run. thanks, Jeffery, this was fantastic! +01:11:07 Jeffrey Stevens: end +01:11:43 Derek Sollberger: Another mental boost from Hadley Wickham: "It’s easy when you start out programming to get really frustrated and think, “Oh it’s me, I’m really stupid,” or, “I’m not made out to program.” But, that is absolutely not the case. Everyone gets frustrated. I still get frustrated occasionally when writing R code. It’s just a natural part of programming. So, it happens to everyone and gets less and less over time. Don’t blame yourself. Just take a break, do something fun, and then come back and try again later." +01:11:58 Olivier Leroy: Reacted to "Another mental boost..." with 👍 +01:12:11 Diana Garcia: Reacted to "Another mental boost..." with 👍 +``` +</details> diff --git a/videos/23/09.qmd b/videos/23/09.qmd @@ -0,0 +1,25 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/EUYeZmskHkE >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:15:40 Derek Sollberger: I tend to measure performance when trying to solve Advent of Code puzzles +00:16:45 Jeffrey Stevens: Do we need to add the chat start? +00:16:51 Olivier Leroy: start +00:21:07 Derek Sollberger: My students and I are currently looking at data about autonomous cars, so the goals of optimizing for smaller computers are indeed incoming +00:21:23 Olivier Leroy: Reacted to "My students and I ar..." with 👍 +00:22:11 Steffi LaZerte (she/her): Reacted to "I tend to measure pe..." with 😁 +00:28:27 Steffi LaZerte (she/her): I don't think I ever realized that GC was garbage collection and that that could contribute to taking up so much time! +00:28:47 Steffi LaZerte (she/her): In other examples ;) +00:39:02 Derek Sollberger: math aside: the square root algorithms date back to the Babylonians :-) +00:41:03 Steffi LaZerte (she/her): Reacted to "math aside: the squa..." with 😀 +01:02:23 Derek Sollberger: The `e1071` R package of miscellaneous functions is also useful for statistical work +01:07:04 Jeffrey Stevens: Gotta go. See you all for the last week next week! +01:08:10 Olivier Leroy: end +``` +</details> diff --git a/videos/24/09.qmd b/videos/24/09.qmd @@ -0,0 +1,25 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/EUYeZmskHkE >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:15:40 Derek Sollberger: I tend to measure performance when trying to solve Advent of Code puzzles +00:16:45 Jeffrey Stevens: Do we need to add the chat start? +00:16:51 Olivier Leroy: start +00:21:07 Derek Sollberger: My students and I are currently looking at data about autonomous cars, so the goals of optimizing for smaller computers are indeed incoming +00:21:23 Olivier Leroy: Reacted to "My students and I ar..." with 👍 +00:22:11 Steffi LaZerte (she/her): Reacted to "I tend to measure pe..." with 😁 +00:28:27 Steffi LaZerte (she/her): I don't think I ever realized that GC was garbage collection and that that could contribute to taking up so much time! +00:28:47 Steffi LaZerte (she/her): In other examples ;) +00:39:02 Derek Sollberger: math aside: the square root algorithms date back to the Babylonians :-) +00:41:03 Steffi LaZerte (she/her): Reacted to "math aside: the squa..." with 😀 +01:02:23 Derek Sollberger: The `e1071` R package of miscellaneous functions is also useful for statistical work +01:07:04 Jeffrey Stevens: Gotta go. See you all for the last week next week! +01:08:10 Olivier Leroy: end +``` +</details> diff --git a/videos/25/09.qmd b/videos/25/09.qmd @@ -0,0 +1,40 @@ +--- +title: Cohort 9 +--- + +{{< video https://www.youtube.com/embed/v3hnYvUuyyk >}} + +<details> + +<summary>Meeting chat log</summary> +``` +00:07:59 Derek Sollberger: When the scale changes, consider using a C++ array :-p +00:08:14 Olivier Leroy: Reacted to "When the scale chang..." with 😄 +00:08:19 Diana Garcia: Reacted to "When the scale chang..." with 😄 +00:11:51 Steffi LaZerte (she/her): Reacted to "When the scale chang..." with 😅 +00:15:36 Olivier Leroy: start +00:19:35 Olivier Leroy: statement +00:25:29 Derek Sollberger: Does any IDE do code highlighting where different chunks might be in different languages? +00:25:33 Steffi LaZerte (she/her): So does that mean there are no vectors in C++? +00:25:43 Olivier Leroy: Array +00:25:54 Steffi LaZerte (she/her): Ah! +00:38:15 Olivier Leroy: Casting is the operation to change/specify data types +00:38:39 Derek Sollberger: Reacted to "Casting is the opera..." with 👍 +00:39:36 Jeffrey Stevens: Reacted to "Casting is the opera..." with 👍 +00:43:39 Olivier Leroy: More like Python +00:45:21 Diana Garcia: https://stackoverflow.com/questions/4955198/what-does-dereferencing-a-pointer-mean-in-c-c +00:45:26 Olivier Leroy: Reacted to "https://stackoverflo..." with 👍 +00:45:40 Derek Sollberger: Reacted to "https://stackoverflo..." with 👆 +00:49:50 Olivier Leroy: Similar that R function at first +00:49:57 Olivier Leroy: Documentation +00:50:00 Steffi LaZerte (she/her): Reacted to "Similar that R funct..." with 😅 +00:53:53 Olivier Leroy: It is classical interview question ... +00:54:01 Diana Garcia: https://en.wikipedia.org/wiki/Gibbs_sampling +00:54:05 Olivier Leroy: I had it once … +00:55:19 Derek Sollberger: Replying to "https://en.wikipedia..." + +These advances in MCMC computation speed (about 10 years ago) made it possible to study Bayesian Analysis at the undergraduate level. +00:55:33 Diana Garcia: https://gweissman.github.io/post/rcpp-is-smoking-fast-for-agent-based-models-in-data-frames/ +01:04:43 Steffi LaZerte (she/her): end +``` +</details>