09.qmd (4958B)
1 --- 2 title: Cohort 9 3 --- 4 5 {{< video https://www.youtube.com/embed/PqKQP6hS1z4 >}} 6 7 <details> 8 9 <summary>Meeting chat log</summary> 10 ``` 11 00:05:22 Olivier Leroy: Sorry for being late 12 00:06:00 Diana Garcia Cortes: Hi everyone! 13 00:06:35 Olivier Leroy: Start 14 00:06:39 Derek Sollberger (he/him): The data frame and tibble info will come up again here in chapter 4 anyway 15 00:06:45 Olivier Leroy: Reacted to "The data frame and t..." with π 16 00:10:03 Olivier Leroy: (The use of number on x was so smart π) 17 00:11:31 Olivier Leroy: People who index with float are evil! 18 00:12:48 Derek Sollberger (he/him): Replying to "People who index wit..." 19 20 might be useful in some sort of median index calculation 21 00:13:19 Olivier Leroy: Reacted to "might be useful in s..." with π 22 00:13:31 Olivier Leroy: Replying to "People who index wit..." 23 24 Yup but probably to smart for me 25 00:18:17 Olivier Leroy: Double quote 26 00:18:39 Olivier Leroy: Unless I am dealing with quote in the string 27 00:19:02 Diana Garcia Cortes: Reacted to "Double quote" with β 28 00:20:50 Olivier Leroy: I like the eggs and box of eggs example 29 00:23:17 tataphani: { names of all the students in the class and {{ Just one name 30 00:24:47 tataphani: so {{ would work on both Lists and Vectors ? and same is true for $ 31 00:25:34 Jo Hardin: {{ isnβt used for subsetting, as far as I know. 32 00:25:41 Olivier Leroy: r$> x <- letters 33 34 r$> x[[1]] 35 [1] "a" 36 00:25:52 Jeffrey Stevens: $ doesn't work on vectors 37 00:27:10 Jeffrey Stevens: Unless the vector is named? 38 00:27:23 Olivier Leroy: If the vector is named I think it will works 39 00:27:30 Olivier Leroy: Need to try π 40 00:28:12 Jeffrey Stevens: Nope, doesn't seem to work with named vectors 41 00:28:32 Jo Hardin: my_list[[c(1,2)]] is the same as my_list[[1]][[2]] 42 00:28:57 Jeffrey Stevens: "Error in x$c : $ operator is invalid for atomic vectors" 43 00:29:12 Jo Hardin: Canβt unmute today! 44 00:29:16 Jo Hardin: Sorry 45 00:29:16 Jeffrey Stevens: So $ can't be used for atomic vectors 46 00:29:22 Jo Hardin: Thanks β€οΈ 47 00:30:33 Olivier Leroy: From ?`$` 48 49 > β$β is only valid for recursive objects (and βNULLβ), 50 and is only discussed in the section below on recursive objects. 51 00:30:37 Jo Hardin: Maybe easier to demo w my_list[[2]][[4]] 52 00:30:51 Jeffrey Stevens: Reacted to "From ?`$` 53 54 > β$β is..." with π 55 00:31:41 Olivier Leroy: `$` 56 00:33:09 Olivier Leroy: Return: 57 58 r$> `$` 59 .Primitive("$") 60 00:35:56 Olivier Leroy: Reacted to "Nope, doesn't seem t..." with π 61 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! 62 00:39:31 Olivier Leroy: Reacted to "Just realized from y..." with π 63 00:39:43 Derek Sollberger (he/him): Reacted to "Just realized from y..." with π§ 64 00:40:22 Olivier Leroy: Replying to "Just realized from y..." 65 66 I will need to try, but maybe it is just print and you canβt assign ? 67 00:40:49 Jo Hardin: Replying to "Just realized from yβ¦" 68 Ahhh, right, that makes sense. 69 00:41:20 tataphani: can we also check if matrix empty or not ? 70 00:43:15 Jeffrey Stevens: names() 71 00:45:04 Olivier Leroy: Subsetting seems simple but it is so tricky 72 00:45:18 Jeffrey Stevens: What's the difference between names() and colnames()? 73 00:45:44 Jeffrey Stevens: Ah, so names() doesn't work on matrices? 74 00:49:09 Derek Sollberger (he/him): NROW() and NCOL() [with capital letters] was in exercise 2 of section 3.3.4 75 00:49:39 Olivier Leroy: Reacted to "NROW() and NCOL() [w..." with π 76 00:49:52 Howard Baek: Reacted to "NROW() and NCOL() [w..." with π 77 00:50:18 Derek Sollberger (he/him): Replying to "NROW() and NCOL() [w..." 78 79 "dim() will return NULL when applied to a 1d vector. 80 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" 81 00:51:08 Howard Baek: Replying to "NROW() and NCOL() [w..." 82 83 Sounds like a C function used in R 84 00:52:06 Howard Baek: Replying to "NROW() and NCOL() [w..." 85 86 Nvm, NCOL is base 87 00:53:01 Olivier Leroy: [ always simplify 88 00:53:06 Olivier Leroy: Except on tibble 89 01:04:08 Olivier Leroy: We are out of time I can continue if needed 90 01:04:22 tataphani: please 91 01:04:33 Howard Baek: Me too, I can stay longer 92 01:04:37 Olivier Leroy: Reacted to "please" with π 93 01:04:39 Olivier Leroy: Reacted to "Me too, I can stay l..." with π 94 01:04:57 Tinashe Tapera: I have to go but reminder I am presenting next week! Wish my luck π 95 01:05:12 Olivier Leroy: Replying to "I have to go but rem..." 96 97 Good luck π 98 01:05:25 Howard Baek: Reacted to "I have to go but rem..." with π 99 01:12:50 Olivier Leroy: Btw they will have a base R function for that soon (the subset with order()) 100 01:14:45 Olivier Leroy: I like that trick 101 01:15:33 Olivier Leroy: Kids crashed here sorry π 102 01:16:27 Aaron Grzasko: I need to drop. Great conversation today! Good job, Gabby!. 103 01:17:58 Olivier Leroy: End 104 ``` 105 </details>