bookclub-advr

DSLC Advanced R Book Club
git clone https://git.eamoncaddigan.net/bookclub-advr.git
Log | Files | Refs | README | LICENSE

08.qmd (1427B)


      1 ---
      2 title: Cohort 8
      3 ---
      4 
      5 {{< video https://www.youtube.com/embed/HBkRO13QlIM >}}
      6 
      7 <details>
      8 
      9 <summary>Meeting chat log</summary>
     10 ```
     11 00:13:07	Federica Gazzelloni (she/her):	http://r4ds.io/advr
     12 00:15:46	Federica Gazzelloni (she/her):	start
     13 00:52:35W	Rebecca Butler:	Does anyone know how to print out much more precision for obj_size?
     14 00:53:02	Laura Biggins:	No, I was going to ask the same question.
     15 00:53:48	Federica Gazzelloni (she/her):	https://advanced-r-solutions.rbind.io/names-and-values
     16 00:56:51	Rebecca Butler:	This is fun:
     17 a <- runif(1e6)
     18 a_size <- obj_size(a)
     19 
     20 b <- list(a, a)
     21 b_size <- obj_size(b)
     22 
     23 b_size - a_size
     24 # 64 B
     25 
     26 x <- 1
     27 y <- list(x, x)
     28 obj_size(y) - obj_size(x)
     29 # 64 B
     30 00:58:40	Rebecca Butler:	Replying to "This is fun:
     31 a <- ru..."
     32 
     33 Kind of clarifies that it takes 64 B to make an empty list of length 2
     34 00:58:58	Laura Biggins:	Replying to "This is fun:
     35 a <- ru..."
     36 
     37 > obj_size(list(NULL))
     38 56 B
     39 > obj_size(list(NULL, NULL))
     40 64 B
     41 > obj_size(list(NULL, NULL, NULL))
     42 80 B
     43 00:59:05	Rebecca Butler:	Replying to "This is fun:
     44 a <- ru..."
     45 
     46 empty_list2 <- vector("list", 2)
     47 obj_size(empty_list2)
     48 # 64 B
     49 
     50 empty_list3 <- vector("list", 3)
     51 obj_size(empty_list3)
     52 # 80 B
     53 00:59:32	Rebecca Butler:	Replying to "This is fun:
     54 a <- ru..."
     55 
     56 Haha we were going the exact same place, Laura. yep!
     57 00:59:44	Laura Biggins:	Reacted to "Haha we were going t..." with 👍
     58 01:04:22	Federica Gazzelloni (she/her):	stop
     59 ```
     60 </details>