class: center, middle, inverse, title-slide .title[ #
purrr
] .author[ ### Justin Post ] --- layout: true <div class="my-footer"><img src="data:image/png;base64,#img/logo.png" style="height: 60px;"/></div> --- # `purrr` Package - Provides a `tidyverse` alternative to the `apply()` family + [Cheat sheet](https://rstudio.github.io/cheatsheets/html/purrr.html) --- # `purrr` Package - Provides a `tidyverse` alternative to the `apply()` family + [Cheat sheet](https://rstudio.github.io/cheatsheets/html/purrr.html) - Main advantage is more consistency and some helper functions + [Accepted answer here](https://stackoverflow.com/questions/45101045/why-use-purrrmap-instead-of-lapply) (by Hadley) gives some good details --- # `map()` - Always returns a `list` - First arg is the list, second is the function ```r set.seed(10) my_list <- list(rnorm(100), runif(10), rgamma(40, shape = 1, rate = 1)) map(my_list, mean) ``` ``` ## [[1]] ## [1] -0.1365489 ## ## [[2]] ## [1] 0.5997619 ## ## [[3]] ## [1] 1.108209 ``` --- # `map()` - Allows for shorthand - Suppose we want the second element of each list. Compare: ```r map(my_list, 2) ``` ``` ## [[1]] ## [1] -0.1842525 ## ## [[2]] ## [1] 0.535895 ## ## [[3]] ## [1] 1.076614 ``` ```r lapply(my_list, function(x) x[[2]]) lapply(my_list, `[[`, 2) ``` --- # `purrr` - `purrr` functions also give a shorthand way to make anonymous functions ```r map(my_list, \(x) mean(x)) ``` ``` ## [[1]] ## [1] -0.1365489 ## ## [[2]] ## [1] 0.5997619 ## ## [[3]] ## [1] 1.108209 ``` ```r map(my_list, \(x) max(x)-min(x)) ``` ``` ## [[1]] ## [1] 4.405807 ## ## [[2]] ## [1] 0.8494514 ## ## [[3]] ## [1] 4.150777 ``` --- # `map_*()` - Allows you to specify the type of output ```r map_dbl(my_list, mean) ``` ``` ## [1] -0.1365489 0.5997619 1.1082087 ``` - `map_chr()`, `map_lgl()`, ... return vectors --- # `map2()` - Allows you to apply a function to two similar lists (returns a list) ```r my_list_2 <- list(rnorm(100), runif(10), rgamma(40, shape = 1, rate = 1)) map2(my_list, my_list_2, \(x, y) mean(x)-mean(y)) ``` ``` ## [[1]] ## [1] -0.05717766 ## ## [[2]] ## [1] 0.03301644 ## ## [[3]] ## [1] 0.04992712 ``` --- # `pmap()` - Extends this idea to an arbitrary number of lists ```r my_list_3 <- list(rnorm(100), runif(10), rgamma(40, shape = 1, rate = 1)) pmap(list(my_list, my_list_2, my_list_3), \(x, y, z) (mean(x)-mean(y))/mean(z)) ``` ``` ## [[1]] ## [1] 0.4895469 ## ## [[2]] ## [1] 0.07453712 ## ## [[3]] ## [1] 0.0421021 ``` --- # `walk()` - `walk()` allows you to use a side-effect function but return the original data ```r #just apply the function par(mfrow = c(1, 3)) my_list |> map(hist) ``` <img src="data:image/png;base64,#31-purrr_files/figure-html/unnamed-chunk-9-1.svg" width="200px" style="display: block; margin: auto;" /> ``` ## [[1]] ## $breaks ## [1] -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 ## ## $counts ## [1] 2 4 14 14 22 15 18 8 1 2 ## ## $density ## [1] 0.04 0.08 0.28 0.28 0.44 0.30 0.36 0.16 0.02 0.04 ## ## $mids ## [1] -2.25 -1.75 -1.25 -0.75 -0.25 0.25 0.75 1.25 1.75 2.25 ## ## $xname ## [1] ".x[[i]]" ## ## $equidist ## [1] TRUE ## ## attr(,"class") ## [1] "histogram" ## ## [[2]] ## $breaks ## [1] 0.0 0.2 0.4 0.6 0.8 1.0 ## ## $counts ## [1] 1 2 1 3 3 ## ## $density ## [1] 0.5 1.0 0.5 1.5 1.5 ## ## $mids ## [1] 0.1 0.3 0.5 0.7 0.9 ## ## $xname ## [1] ".x[[i]]" ## ## $equidist ## [1] TRUE ## ## attr(,"class") ## [1] "histogram" ## ## [[3]] ## $breaks ## [1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 ## ## $counts ## [1] 13 9 7 5 1 3 0 1 1 ## ## $density ## [1] 0.65 0.45 0.35 0.25 0.05 0.15 0.00 0.05 0.05 ## ## $mids ## [1] 0.25 0.75 1.25 1.75 2.25 2.75 3.25 3.75 4.25 ## ## $xname ## [1] ".x[[i]]" ## ## $equidist ## [1] TRUE ## ## attr(,"class") ## [1] "histogram" ``` --- # `walk()` - `walk()` allows you to use a side-effect function but return the original data ```r par(mfrow = c(1, 3)) #now apply the function but still have the original data my_list |> walk(hist) |> map_dbl(mean) ``` <img src="data:image/png;base64,#31-purrr_files/figure-html/unnamed-chunk-10-1.svg" width="200px" style="display: block; margin: auto;" /> ``` ## [1] -0.1365489 0.5997619 1.1082087 ``` --- # Summary of Common `purrr` Functions - Plenty of other functionality provided (see [cheat sheet](https://rstudio.github.io/cheatsheets/html/purrr.html)) <img src="data:image/png;base64,#img/purrr.png" width="500px" style="display: block; margin: auto;" /> --- # List Columns - Recall our connection between lists and data frames: + Data frame = list of equal length vectors ```r typeof(iris) ``` ``` ## [1] "list" ``` ```r str(iris) ``` ``` ## 'data.frame': 150 obs. of 5 variables: ## $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... ## $ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... ## $ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ... ## $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... ## $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ... ``` --- # List Columns - Recall our connection between lists and data frames: + Data frame = list of equal length vectors - A list is a vector... if of appropriate length, it can be the column of a data frame! ```r iris |> as_tibble() |> mutate(diffs = pmap(list(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width), \(x, y, z, w) list(x-y, x-z, x-w))) |> select(diffs, everything()) ``` ``` ## # A tibble: 150 x 6 ## diffs Sepal.Length Sepal.Width Petal.Length Petal.Width Species ## <list> <dbl> <dbl> <dbl> <dbl> <fct> ## 1 <list [3]> 5.1 3.5 1.4 0.2 setosa ## 2 <list [3]> 4.9 3 1.4 0.2 setosa ## 3 <list [3]> 4.7 3.2 1.3 0.2 setosa ## 4 <list [3]> 4.6 3.1 1.5 0.2 setosa ## 5 <list [3]> 5 3.6 1.4 0.2 setosa ## # i 145 more rows ``` --- # List Columns - Recall our connection between lists and data frames: + Data frame = list of equal length vectors - A list is a vector... if of appropriate length, it can be the column of a data frame! ```r iris |> as_tibble() |> mutate(diffs = pmap(list(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width), \(x, y, z, w) list(x-y, x-z, x-w))) |> pull(diffs) ``` ``` ## [[1]] ## [[1]][[1]] ## [1] 1.6 ## ## [[1]][[2]] ## [1] 3.7 ## ## [[1]][[3]] ## [1] 4.9 ## ## ## [[2]] ## [[2]][[1]] ## [1] 1.9 ## ## [[2]][[2]] ## [1] 3.5 ## ## [[2]][[3]] ## [1] 4.7 ## ## ## [[3]] ## [[3]][[1]] ## [1] 1.5 ## ## [[3]][[2]] ## [1] 3.4 ## ## [[3]][[3]] ## [1] 4.5 ## ## ## [[4]] ## [[4]][[1]] ## [1] 1.5 ## ## [[4]][[2]] ## [1] 3.1 ## ## [[4]][[3]] ## [1] 4.4 ## ## ## [[5]] ## [[5]][[1]] ## [1] 1.4 ## ## [[5]][[2]] ## [1] 3.6 ## ## [[5]][[3]] ## [1] 4.8 ## ## ## [[6]] ## [[6]][[1]] ## [1] 1.5 ## ## [[6]][[2]] ## [1] 3.7 ## ## [[6]][[3]] ## [1] 5 ## ## ## [[7]] ## [[7]][[1]] ## [1] 1.2 ## ## [[7]][[2]] ## [1] 3.2 ## ## [[7]][[3]] ## [1] 4.3 ## ## ## [[8]] ## [[8]][[1]] ## [1] 1.6 ## ## [[8]][[2]] ## [1] 3.5 ## ## [[8]][[3]] ## [1] 4.8 ## ## ## [[9]] ## [[9]][[1]] ## [1] 1.5 ## ## [[9]][[2]] ## [1] 3 ## ## [[9]][[3]] ## [1] 4.2 ## ## ## [[10]] ## [[10]][[1]] ## [1] 1.8 ## ## [[10]][[2]] ## [1] 3.4 ## ## [[10]][[3]] ## [1] 4.8 ## ## ## [[11]] ## [[11]][[1]] ## [1] 1.7 ## ## [[11]][[2]] ## [1] 3.9 ## ## [[11]][[3]] ## [1] 5.2 ## ## ## [[12]] ## [[12]][[1]] ## [1] 1.4 ## ## [[12]][[2]] ## [1] 3.2 ## ## [[12]][[3]] ## [1] 4.6 ## ## ## [[13]] ## [[13]][[1]] ## [1] 1.8 ## ## [[13]][[2]] ## [1] 3.4 ## ## [[13]][[3]] ## [1] 4.7 ## ## ## [[14]] ## [[14]][[1]] ## [1] 1.3 ## ## [[14]][[2]] ## [1] 3.2 ## ## [[14]][[3]] ## [1] 4.2 ## ## ## [[15]] ## [[15]][[1]] ## [1] 1.8 ## ## [[15]][[2]] ## [1] 4.6 ## ## [[15]][[3]] ## [1] 5.6 ## ## ## [[16]] ## [[16]][[1]] ## [1] 1.3 ## ## [[16]][[2]] ## [1] 4.2 ## ## [[16]][[3]] ## [1] 5.3 ## ## ## [[17]] ## [[17]][[1]] ## [1] 1.5 ## ## [[17]][[2]] ## [1] 4.1 ## ## [[17]][[3]] ## [1] 5 ## ## ## [[18]] ## [[18]][[1]] ## [1] 1.6 ## ## [[18]][[2]] ## [1] 3.7 ## ## [[18]][[3]] ## [1] 4.8 ## ## ## [[19]] ## [[19]][[1]] ## [1] 1.9 ## ## [[19]][[2]] ## [1] 4 ## ## [[19]][[3]] ## [1] 5.4 ## ## ## [[20]] ## [[20]][[1]] ## [1] 1.3 ## ## [[20]][[2]] ## [1] 3.6 ## ## [[20]][[3]] ## [1] 4.8 ## ## ## [[21]] ## [[21]][[1]] ## [1] 2 ## ## [[21]][[2]] ## [1] 3.7 ## ## [[21]][[3]] ## [1] 5.2 ## ## ## [[22]] ## [[22]][[1]] ## [1] 1.4 ## ## [[22]][[2]] ## [1] 3.6 ## ## [[22]][[3]] ## [1] 4.7 ## ## ## [[23]] ## [[23]][[1]] ## [1] 1 ## ## [[23]][[2]] ## [1] 3.6 ## ## [[23]][[3]] ## [1] 4.4 ## ## ## [[24]] ## [[24]][[1]] ## [1] 1.8 ## ## [[24]][[2]] ## [1] 3.4 ## ## [[24]][[3]] ## [1] 4.6 ## ## ## [[25]] ## [[25]][[1]] ## [1] 1.4 ## ## [[25]][[2]] ## [1] 2.9 ## ## [[25]][[3]] ## [1] 4.6 ## ## ## [[26]] ## [[26]][[1]] ## [1] 2 ## ## [[26]][[2]] ## [1] 3.4 ## ## [[26]][[3]] ## [1] 4.8 ## ## ## [[27]] ## [[27]][[1]] ## [1] 1.6 ## ## [[27]][[2]] ## [1] 3.4 ## ## [[27]][[3]] ## [1] 4.6 ## ## ## [[28]] ## [[28]][[1]] ## [1] 1.7 ## ## [[28]][[2]] ## [1] 3.7 ## ## [[28]][[3]] ## [1] 5 ## ## ## [[29]] ## [[29]][[1]] ## [1] 1.8 ## ## [[29]][[2]] ## [1] 3.8 ## ## [[29]][[3]] ## [1] 5 ## ## ## [[30]] ## [[30]][[1]] ## [1] 1.5 ## ## [[30]][[2]] ## [1] 3.1 ## ## [[30]][[3]] ## [1] 4.5 ## ## ## [[31]] ## [[31]][[1]] ## [1] 1.7 ## ## [[31]][[2]] ## [1] 3.2 ## ## [[31]][[3]] ## [1] 4.6 ## ## ## [[32]] ## [[32]][[1]] ## [1] 2 ## ## [[32]][[2]] ## [1] 3.9 ## ## [[32]][[3]] ## [1] 5 ## ## ## [[33]] ## [[33]][[1]] ## [1] 1.1 ## ## [[33]][[2]] ## [1] 3.7 ## ## [[33]][[3]] ## [1] 5.1 ## ## ## [[34]] ## [[34]][[1]] ## [1] 1.3 ## ## [[34]][[2]] ## [1] 4.1 ## ## [[34]][[3]] ## [1] 5.3 ## ## ## [[35]] ## [[35]][[1]] ## [1] 1.8 ## ## [[35]][[2]] ## [1] 3.4 ## ## [[35]][[3]] ## [1] 4.7 ## ## ## [[36]] ## [[36]][[1]] ## [1] 1.8 ## ## [[36]][[2]] ## [1] 3.8 ## ## [[36]][[3]] ## [1] 4.8 ## ## ## [[37]] ## [[37]][[1]] ## [1] 2 ## ## [[37]][[2]] ## [1] 4.2 ## ## [[37]][[3]] ## [1] 5.3 ## ## ## [[38]] ## [[38]][[1]] ## [1] 1.3 ## ## [[38]][[2]] ## [1] 3.5 ## ## [[38]][[3]] ## [1] 4.8 ## ## ## [[39]] ## [[39]][[1]] ## [1] 1.4 ## ## [[39]][[2]] ## [1] 3.1 ## ## [[39]][[3]] ## [1] 4.2 ## ## ## [[40]] ## [[40]][[1]] ## [1] 1.7 ## ## [[40]][[2]] ## [1] 3.6 ## ## [[40]][[3]] ## [1] 4.9 ## ## ## [[41]] ## [[41]][[1]] ## [1] 1.5 ## ## [[41]][[2]] ## [1] 3.7 ## ## [[41]][[3]] ## [1] 4.7 ## ## ## [[42]] ## [[42]][[1]] ## [1] 2.2 ## ## [[42]][[2]] ## [1] 3.2 ## ## [[42]][[3]] ## [1] 4.2 ## ## ## [[43]] ## [[43]][[1]] ## [1] 1.2 ## ## [[43]][[2]] ## [1] 3.1 ## ## [[43]][[3]] ## [1] 4.2 ## ## ## [[44]] ## [[44]][[1]] ## [1] 1.5 ## ## [[44]][[2]] ## [1] 3.4 ## ## [[44]][[3]] ## [1] 4.4 ## ## ## [[45]] ## [[45]][[1]] ## [1] 1.3 ## ## [[45]][[2]] ## [1] 3.2 ## ## [[45]][[3]] ## [1] 4.7 ## ## ## [[46]] ## [[46]][[1]] ## [1] 1.8 ## ## [[46]][[2]] ## [1] 3.4 ## ## [[46]][[3]] ## [1] 4.5 ## ## ## [[47]] ## [[47]][[1]] ## [1] 1.3 ## ## [[47]][[2]] ## [1] 3.5 ## ## [[47]][[3]] ## [1] 4.9 ## ## ## [[48]] ## [[48]][[1]] ## [1] 1.4 ## ## [[48]][[2]] ## [1] 3.2 ## ## [[48]][[3]] ## [1] 4.4 ## ## ## [[49]] ## [[49]][[1]] ## [1] 1.6 ## ## [[49]][[2]] ## [1] 3.8 ## ## [[49]][[3]] ## [1] 5.1 ## ## ## [[50]] ## [[50]][[1]] ## [1] 1.7 ## ## [[50]][[2]] ## [1] 3.6 ## ## [[50]][[3]] ## [1] 4.8 ## ## ## [[51]] ## [[51]][[1]] ## [1] 3.8 ## ## [[51]][[2]] ## [1] 2.3 ## ## [[51]][[3]] ## [1] 5.6 ## ## ## [[52]] ## [[52]][[1]] ## [1] 3.2 ## ## [[52]][[2]] ## [1] 1.9 ## ## [[52]][[3]] ## [1] 4.9 ## ## ## [[53]] ## [[53]][[1]] ## [1] 3.8 ## ## [[53]][[2]] ## [1] 2 ## ## [[53]][[3]] ## [1] 5.4 ## ## ## [[54]] ## [[54]][[1]] ## [1] 3.2 ## ## [[54]][[2]] ## [1] 1.5 ## ## [[54]][[3]] ## [1] 4.2 ## ## ## [[55]] ## [[55]][[1]] ## [1] 3.7 ## ## [[55]][[2]] ## [1] 1.9 ## ## [[55]][[3]] ## [1] 5 ## ## ## [[56]] ## [[56]][[1]] ## [1] 2.9 ## ## [[56]][[2]] ## [1] 1.2 ## ## [[56]][[3]] ## [1] 4.4 ## ## ## [[57]] ## [[57]][[1]] ## [1] 3 ## ## [[57]][[2]] ## [1] 1.6 ## ## [[57]][[3]] ## [1] 4.7 ## ## ## [[58]] ## [[58]][[1]] ## [1] 2.5 ## ## [[58]][[2]] ## [1] 1.6 ## ## [[58]][[3]] ## [1] 3.9 ## ## ## [[59]] ## [[59]][[1]] ## [1] 3.7 ## ## [[59]][[2]] ## [1] 2 ## ## [[59]][[3]] ## [1] 5.3 ## ## ## [[60]] ## [[60]][[1]] ## [1] 2.5 ## ## [[60]][[2]] ## [1] 1.3 ## ## [[60]][[3]] ## [1] 3.8 ## ## ## [[61]] ## [[61]][[1]] ## [1] 3 ## ## [[61]][[2]] ## [1] 1.5 ## ## [[61]][[3]] ## [1] 4 ## ## ## [[62]] ## [[62]][[1]] ## [1] 2.9 ## ## [[62]][[2]] ## [1] 1.7 ## ## [[62]][[3]] ## [1] 4.4 ## ## ## [[63]] ## [[63]][[1]] ## [1] 3.8 ## ## [[63]][[2]] ## [1] 2 ## ## [[63]][[3]] ## [1] 5 ## ## ## [[64]] ## [[64]][[1]] ## [1] 3.2 ## ## [[64]][[2]] ## [1] 1.4 ## ## [[64]][[3]] ## [1] 4.7 ## ## ## [[65]] ## [[65]][[1]] ## [1] 2.7 ## ## [[65]][[2]] ## [1] 2 ## ## [[65]][[3]] ## [1] 4.3 ## ## ## [[66]] ## [[66]][[1]] ## [1] 3.6 ## ## [[66]][[2]] ## [1] 2.3 ## ## [[66]][[3]] ## [1] 5.3 ## ## ## [[67]] ## [[67]][[1]] ## [1] 2.6 ## ## [[67]][[2]] ## [1] 1.1 ## ## [[67]][[3]] ## [1] 4.1 ## ## ## [[68]] ## [[68]][[1]] ## [1] 3.1 ## ## [[68]][[2]] ## [1] 1.7 ## ## [[68]][[3]] ## [1] 4.8 ## ## ## [[69]] ## [[69]][[1]] ## [1] 4 ## ## [[69]][[2]] ## [1] 1.7 ## ## [[69]][[3]] ## [1] 4.7 ## ## ## [[70]] ## [[70]][[1]] ## [1] 3.1 ## ## [[70]][[2]] ## [1] 1.7 ## ## [[70]][[3]] ## [1] 4.5 ## ## ## [[71]] ## [[71]][[1]] ## [1] 2.7 ## ## [[71]][[2]] ## [1] 1.1 ## ## [[71]][[3]] ## [1] 4.1 ## ## ## [[72]] ## [[72]][[1]] ## [1] 3.3 ## ## [[72]][[2]] ## [1] 2.1 ## ## [[72]][[3]] ## [1] 4.8 ## ## ## [[73]] ## [[73]][[1]] ## [1] 3.8 ## ## [[73]][[2]] ## [1] 1.4 ## ## [[73]][[3]] ## [1] 4.8 ## ## ## [[74]] ## [[74]][[1]] ## [1] 3.3 ## ## [[74]][[2]] ## [1] 1.4 ## ## [[74]][[3]] ## [1] 4.9 ## ## ## [[75]] ## [[75]][[1]] ## [1] 3.5 ## ## [[75]][[2]] ## [1] 2.1 ## ## [[75]][[3]] ## [1] 5.1 ## ## ## [[76]] ## [[76]][[1]] ## [1] 3.6 ## ## [[76]][[2]] ## [1] 2.2 ## ## [[76]][[3]] ## [1] 5.2 ## ## ## [[77]] ## [[77]][[1]] ## [1] 4 ## ## [[77]][[2]] ## [1] 2 ## ## [[77]][[3]] ## [1] 5.4 ## ## ## [[78]] ## [[78]][[1]] ## [1] 3.7 ## ## [[78]][[2]] ## [1] 1.7 ## ## [[78]][[3]] ## [1] 5 ## ## ## [[79]] ## [[79]][[1]] ## [1] 3.1 ## ## [[79]][[2]] ## [1] 1.5 ## ## [[79]][[3]] ## [1] 4.5 ## ## ## [[80]] ## [[80]][[1]] ## [1] 3.1 ## ## [[80]][[2]] ## [1] 2.2 ## ## [[80]][[3]] ## [1] 4.7 ## ## ## [[81]] ## [[81]][[1]] ## [1] 3.1 ## ## [[81]][[2]] ## [1] 1.7 ## ## [[81]][[3]] ## [1] 4.4 ## ## ## [[82]] ## [[82]][[1]] ## [1] 3.1 ## ## [[82]][[2]] ## [1] 1.8 ## ## [[82]][[3]] ## [1] 4.5 ## ## ## [[83]] ## [[83]][[1]] ## [1] 3.1 ## ## [[83]][[2]] ## [1] 1.9 ## ## [[83]][[3]] ## [1] 4.6 ## ## ## [[84]] ## [[84]][[1]] ## [1] 3.3 ## ## [[84]][[2]] ## [1] 0.9 ## ## [[84]][[3]] ## [1] 4.4 ## ## ## [[85]] ## [[85]][[1]] ## [1] 2.4 ## ## [[85]][[2]] ## [1] 0.9 ## ## [[85]][[3]] ## [1] 3.9 ## ## ## [[86]] ## [[86]][[1]] ## [1] 2.6 ## ## [[86]][[2]] ## [1] 1.5 ## ## [[86]][[3]] ## [1] 4.4 ## ## ## [[87]] ## [[87]][[1]] ## [1] 3.6 ## ## [[87]][[2]] ## [1] 2 ## ## [[87]][[3]] ## [1] 5.2 ## ## ## [[88]] ## [[88]][[1]] ## [1] 4 ## ## [[88]][[2]] ## [1] 1.9 ## ## [[88]][[3]] ## [1] 5 ## ## ## [[89]] ## [[89]][[1]] ## [1] 2.6 ## ## [[89]][[2]] ## [1] 1.5 ## ## [[89]][[3]] ## [1] 4.3 ## ## ## [[90]] ## [[90]][[1]] ## [1] 3 ## ## [[90]][[2]] ## [1] 1.5 ## ## [[90]][[3]] ## [1] 4.2 ## ## ## [[91]] ## [[91]][[1]] ## [1] 2.9 ## ## [[91]][[2]] ## [1] 1.1 ## ## [[91]][[3]] ## [1] 4.3 ## ## ## [[92]] ## [[92]][[1]] ## [1] 3.1 ## ## [[92]][[2]] ## [1] 1.5 ## ## [[92]][[3]] ## [1] 4.7 ## ## ## [[93]] ## [[93]][[1]] ## [1] 3.2 ## ## [[93]][[2]] ## [1] 1.8 ## ## [[93]][[3]] ## [1] 4.6 ## ## ## [[94]] ## [[94]][[1]] ## [1] 2.7 ## ## [[94]][[2]] ## [1] 1.7 ## ## [[94]][[3]] ## [1] 4 ## ## ## [[95]] ## [[95]][[1]] ## [1] 2.9 ## ## [[95]][[2]] ## [1] 1.4 ## ## [[95]][[3]] ## [1] 4.3 ## ## ## [[96]] ## [[96]][[1]] ## [1] 2.7 ## ## [[96]][[2]] ## [1] 1.5 ## ## [[96]][[3]] ## [1] 4.5 ## ## ## [[97]] ## [[97]][[1]] ## [1] 2.8 ## ## [[97]][[2]] ## [1] 1.5 ## ## [[97]][[3]] ## [1] 4.4 ## ## ## [[98]] ## [[98]][[1]] ## [1] 3.3 ## ## [[98]][[2]] ## [1] 1.9 ## ## [[98]][[3]] ## [1] 4.9 ## ## ## [[99]] ## [[99]][[1]] ## [1] 2.6 ## ## [[99]][[2]] ## [1] 2.1 ## ## [[99]][[3]] ## [1] 4 ## ## ## [[100]] ## [[100]][[1]] ## [1] 2.9 ## ## [[100]][[2]] ## [1] 1.6 ## ## [[100]][[3]] ## [1] 4.4 ## ## ## [[101]] ## [[101]][[1]] ## [1] 3 ## ## [[101]][[2]] ## [1] 0.3 ## ## [[101]][[3]] ## [1] 3.8 ## ## ## [[102]] ## [[102]][[1]] ## [1] 3.1 ## ## [[102]][[2]] ## [1] 0.7 ## ## [[102]][[3]] ## [1] 3.9 ## ## ## [[103]] ## [[103]][[1]] ## [1] 4.1 ## ## [[103]][[2]] ## [1] 1.2 ## ## [[103]][[3]] ## [1] 5 ## ## ## [[104]] ## [[104]][[1]] ## [1] 3.4 ## ## [[104]][[2]] ## [1] 0.7 ## ## [[104]][[3]] ## [1] 4.5 ## ## ## [[105]] ## [[105]][[1]] ## [1] 3.5 ## ## [[105]][[2]] ## [1] 0.7 ## ## [[105]][[3]] ## [1] 4.3 ## ## ## [[106]] ## [[106]][[1]] ## [1] 4.6 ## ## [[106]][[2]] ## [1] 1 ## ## [[106]][[3]] ## [1] 5.5 ## ## ## [[107]] ## [[107]][[1]] ## [1] 2.4 ## ## [[107]][[2]] ## [1] 0.4 ## ## [[107]][[3]] ## [1] 3.2 ## ## ## [[108]] ## [[108]][[1]] ## [1] 4.4 ## ## [[108]][[2]] ## [1] 1 ## ## [[108]][[3]] ## [1] 5.5 ## ## ## [[109]] ## [[109]][[1]] ## [1] 4.2 ## ## [[109]][[2]] ## [1] 0.9 ## ## [[109]][[3]] ## [1] 4.9 ## ## ## [[110]] ## [[110]][[1]] ## [1] 3.6 ## ## [[110]][[2]] ## [1] 1.1 ## ## [[110]][[3]] ## [1] 4.7 ## ## ## [[111]] ## [[111]][[1]] ## [1] 3.3 ## ## [[111]][[2]] ## [1] 1.4 ## ## [[111]][[3]] ## [1] 4.5 ## ## ## [[112]] ## [[112]][[1]] ## [1] 3.7 ## ## [[112]][[2]] ## [1] 1.1 ## ## [[112]][[3]] ## [1] 4.5 ## ## ## [[113]] ## [[113]][[1]] ## [1] 3.8 ## ## [[113]][[2]] ## [1] 1.3 ## ## [[113]][[3]] ## [1] 4.7 ## ## ## [[114]] ## [[114]][[1]] ## [1] 3.2 ## ## [[114]][[2]] ## [1] 0.7 ## ## [[114]][[3]] ## [1] 3.7 ## ## ## [[115]] ## [[115]][[1]] ## [1] 3 ## ## [[115]][[2]] ## [1] 0.7 ## ## [[115]][[3]] ## [1] 3.4 ## ## ## [[116]] ## [[116]][[1]] ## [1] 3.2 ## ## [[116]][[2]] ## [1] 1.1 ## ## [[116]][[3]] ## [1] 4.1 ## ## ## [[117]] ## [[117]][[1]] ## [1] 3.5 ## ## [[117]][[2]] ## [1] 1 ## ## [[117]][[3]] ## [1] 4.7 ## ## ## [[118]] ## [[118]][[1]] ## [1] 3.9 ## ## [[118]][[2]] ## [1] 1 ## ## [[118]][[3]] ## [1] 5.5 ## ## ## [[119]] ## [[119]][[1]] ## [1] 5.1 ## ## [[119]][[2]] ## [1] 0.8 ## ## [[119]][[3]] ## [1] 5.4 ## ## ## [[120]] ## [[120]][[1]] ## [1] 3.8 ## ## [[120]][[2]] ## [1] 1 ## ## [[120]][[3]] ## [1] 4.5 ## ## ## [[121]] ## [[121]][[1]] ## [1] 3.7 ## ## [[121]][[2]] ## [1] 1.2 ## ## [[121]][[3]] ## [1] 4.6 ## ## ## [[122]] ## [[122]][[1]] ## [1] 2.8 ## ## [[122]][[2]] ## [1] 0.7 ## ## [[122]][[3]] ## [1] 3.6 ## ## ## [[123]] ## [[123]][[1]] ## [1] 4.9 ## ## [[123]][[2]] ## [1] 1 ## ## [[123]][[3]] ## [1] 5.7 ## ## ## [[124]] ## [[124]][[1]] ## [1] 3.6 ## ## [[124]][[2]] ## [1] 1.4 ## ## [[124]][[3]] ## [1] 4.5 ## ## ## [[125]] ## [[125]][[1]] ## [1] 3.4 ## ## [[125]][[2]] ## [1] 1 ## ## [[125]][[3]] ## [1] 4.6 ## ## ## [[126]] ## [[126]][[1]] ## [1] 4 ## ## [[126]][[2]] ## [1] 1.2 ## ## [[126]][[3]] ## [1] 5.4 ## ## ## [[127]] ## [[127]][[1]] ## [1] 3.4 ## ## [[127]][[2]] ## [1] 1.4 ## ## [[127]][[3]] ## [1] 4.4 ## ## ## [[128]] ## [[128]][[1]] ## [1] 3.1 ## ## [[128]][[2]] ## [1] 1.2 ## ## [[128]][[3]] ## [1] 4.3 ## ## ## [[129]] ## [[129]][[1]] ## [1] 3.6 ## ## [[129]][[2]] ## [1] 0.8 ## ## [[129]][[3]] ## [1] 4.3 ## ## ## [[130]] ## [[130]][[1]] ## [1] 4.2 ## ## [[130]][[2]] ## [1] 1.4 ## ## [[130]][[3]] ## [1] 5.6 ## ## ## [[131]] ## [[131]][[1]] ## [1] 4.6 ## ## [[131]][[2]] ## [1] 1.3 ## ## [[131]][[3]] ## [1] 5.5 ## ## ## [[132]] ## [[132]][[1]] ## [1] 4.1 ## ## [[132]][[2]] ## [1] 1.5 ## ## [[132]][[3]] ## [1] 5.9 ## ## ## [[133]] ## [[133]][[1]] ## [1] 3.6 ## ## [[133]][[2]] ## [1] 0.8 ## ## [[133]][[3]] ## [1] 4.2 ## ## ## [[134]] ## [[134]][[1]] ## [1] 3.5 ## ## [[134]][[2]] ## [1] 1.2 ## ## [[134]][[3]] ## [1] 4.8 ## ## ## [[135]] ## [[135]][[1]] ## [1] 3.5 ## ## [[135]][[2]] ## [1] 0.5 ## ## [[135]][[3]] ## [1] 4.7 ## ## ## [[136]] ## [[136]][[1]] ## [1] 4.7 ## ## [[136]][[2]] ## [1] 1.6 ## ## [[136]][[3]] ## [1] 5.4 ## ## ## [[137]] ## [[137]][[1]] ## [1] 2.9 ## ## [[137]][[2]] ## [1] 0.7 ## ## [[137]][[3]] ## [1] 3.9 ## ## ## [[138]] ## [[138]][[1]] ## [1] 3.3 ## ## [[138]][[2]] ## [1] 0.9 ## ## [[138]][[3]] ## [1] 4.6 ## ## ## [[139]] ## [[139]][[1]] ## [1] 3 ## ## [[139]][[2]] ## [1] 1.2 ## ## [[139]][[3]] ## [1] 4.2 ## ## ## [[140]] ## [[140]][[1]] ## [1] 3.8 ## ## [[140]][[2]] ## [1] 1.5 ## ## [[140]][[3]] ## [1] 4.8 ## ## ## [[141]] ## [[141]][[1]] ## [1] 3.6 ## ## [[141]][[2]] ## [1] 1.1 ## ## [[141]][[3]] ## [1] 4.3 ## ## ## [[142]] ## [[142]][[1]] ## [1] 3.8 ## ## [[142]][[2]] ## [1] 1.8 ## ## [[142]][[3]] ## [1] 4.6 ## ## ## [[143]] ## [[143]][[1]] ## [1] 3.1 ## ## [[143]][[2]] ## [1] 0.7 ## ## [[143]][[3]] ## [1] 3.9 ## ## ## [[144]] ## [[144]][[1]] ## [1] 3.6 ## ## [[144]][[2]] ## [1] 0.9 ## ## [[144]][[3]] ## [1] 4.5 ## ## ## [[145]] ## [[145]][[1]] ## [1] 3.4 ## ## [[145]][[2]] ## [1] 1 ## ## [[145]][[3]] ## [1] 4.2 ## ## ## [[146]] ## [[146]][[1]] ## [1] 3.7 ## ## [[146]][[2]] ## [1] 1.5 ## ## [[146]][[3]] ## [1] 4.4 ## ## ## [[147]] ## [[147]][[1]] ## [1] 3.8 ## ## [[147]][[2]] ## [1] 1.3 ## ## [[147]][[3]] ## [1] 4.4 ## ## ## [[148]] ## [[148]][[1]] ## [1] 3.5 ## ## [[148]][[2]] ## [1] 1.3 ## ## [[148]][[3]] ## [1] 4.5 ## ## ## [[149]] ## [[149]][[1]] ## [1] 2.8 ## ## [[149]][[2]] ## [1] 0.8 ## ## [[149]][[3]] ## [1] 3.9 ## ## ## [[150]] ## [[150]][[1]] ## [1] 2.9 ## ## [[150]][[2]] ## [1] 0.8 ## ## [[150]][[3]] ## [1] 4.1 ``` --- # List Columns - A more interesting example! - Note: `purrr:pluck()` is a helper function for grabbing a named element or by index number ```r library(httr) library(jsonlite) game_info <- GET("https://api-web.nhle.com/v1/score/2024-04-04") |> content("text") |> fromJSON(flatten = TRUE, simplifyDataFrame = TRUE) |> pluck("games") ``` - `pluck()` could be replaced with ``` `[[`("games") ``` --- # List-Columns - Check the `tvBroadcasts` column! ```r str(game_info, max.level = 1) ``` ``` ## 'data.frame': 9 obs. of 40 variables: ## $ id : int 2023021202 2023021203 2023021204 2023021205 2023021206 2023021207 2023021208 2023021209 2023021210 ## $ season : int 20232024 20232024 20232024 20232024 20232024 20232024 20232024 20232024 20232024 ## $ gameType : int 2 2 2 2 2 2 2 2 2 ## $ gameDate : chr "2024-04-04" "2024-04-04" "2024-04-04" "2024-04-04" ... ## $ startTimeUTC : chr "2024-04-04T23:00:00Z" "2024-04-04T23:00:00Z" "2024-04-04T23:00:00Z" "2024-04-04T23:00:00Z" ... ## $ easternUTCOffset : chr "-04:00" "-04:00" "-04:00" "-04:00" ... ## $ venueUTCOffset : chr "-04:00" "-04:00" "-04:00" "-04:00" ... ## $ tvBroadcasts :List of 9 ## $ gameState : chr "OFF" "OFF" "OFF" "OFF" ... ## $ gameScheduleState : chr "OK" "OK" "OK" "OK" ... ## $ gameCenterLink : chr "/gamecenter/bos-vs-car/2024/04/04/2023021202" "/gamecenter/nyi-vs-cbj/2024/04/04/2023021203" "/gamecenter/tbl-vs-mtl/2024/04/04/2023021204" "/gamecenter/fla-vs-ott/2024/04/04/2023021205" ... ## $ threeMinRecap : chr "/video/recap-bruins-at-hurricanes-4-4-24-6350293603112" "/video/recap-islanders-at-blue-jackets-4-4-24-6350292452112" "/video/recap-lightning-at-canadiens-4-4-24-6350291670112" "/video/recap-panthers-at-senators-4-4-24-6350292147112" ... ## $ neutralSite : logi FALSE FALSE FALSE FALSE FALSE FALSE ... ## $ venueTimezone : chr "US/Eastern" "US/Eastern" "America/Montreal" "US/Eastern" ... ## $ period : int 3 3 3 3 3 3 3 3 3 ## $ goals :List of 9 ## $ threeMinRecapFr : chr NA NA "/fr/video/recap-lightning-at-canadiens-4-4-24-6350292258112" "/fr/video/recap-panthers-at-senators-4-4-24-6350293225112" ... ## $ condensedGame : chr NA NA NA NA ... ## $ venue.default : chr "PNC Arena" "Nationwide Arena" "Centre Bell" "Canadian Tire Centre" ... ## $ awayTeam.id : int 6 2 14 13 5 21 19 20 26 ## $ awayTeam.abbrev : chr "BOS" "NYI" "TBL" "FLA" ... ## $ awayTeam.score : int 4 4 7 6 4 5 3 2 2 ## $ awayTeam.sog : int 28 41 35 31 24 36 47 33 27 ## $ awayTeam.logo : chr "https://assets.nhle.com/logos/nhl/svg/BOS_20232024_light.svg" "https://assets.nhle.com/logos/nhl/svg/NYI_light.svg" "https://assets.nhle.com/logos/nhl/svg/TBL_light.svg" "https://assets.nhle.com/logos/nhl/svg/FLA_light.svg" ... ## $ awayTeam.name.default : chr "Bruins" "Islanders" "Lightning" "Panthers" ... ## $ homeTeam.id : int 12 29 8 9 15 30 18 52 28 ## $ homeTeam.abbrev : chr "CAR" "CBJ" "MTL" "OTT" ... ## $ homeTeam.score : int 1 2 4 0 1 2 6 5 1 ## $ homeTeam.sog : int 29 27 30 30 31 46 31 45 16 ## $ homeTeam.logo : chr "https://assets.nhle.com/logos/nhl/svg/CAR_light.svg" "https://assets.nhle.com/logos/nhl/svg/CBJ_light.svg" "https://assets.nhle.com/logos/nhl/svg/MTL_light.svg" "https://assets.nhle.com/logos/nhl/svg/OTT_light.svg" ... ## $ homeTeam.name.default : chr "Hurricanes" "Blue Jackets" "Canadiens" "Senators" ... ## $ homeTeam.name.fr : chr NA NA NA "Sénateurs" ... ## $ clock.timeRemaining : chr "00:00" "00:00" "00:00" "00:00" ... ## $ clock.secondsRemaining : int 0 0 0 0 0 0 0 0 0 ## $ clock.running : logi FALSE FALSE FALSE FALSE FALSE FALSE ... ## $ clock.inIntermission : logi FALSE FALSE FALSE FALSE FALSE FALSE ... ## $ periodDescriptor.number : int 3 3 3 3 3 3 3 3 3 ## $ periodDescriptor.periodType : chr "REG" "REG" "REG" "REG" ... ## $ periodDescriptor.maxRegulationPeriods: int 3 3 3 3 3 3 3 3 3 ## $ gameOutcome.lastPeriodType : chr "REG" "REG" "REG" "REG" ... ``` --- # Working with List-Columns - In this case, our list-column contains a data frame in each list element: ```r game_info$tvBroadcasts ``` ``` ## [[1]] ## id market countryCode network sequenceNumber ## 1 375 H US BSSO 390 ## 2 31 A US NESN 396 ## ## [[2]] ## id market countryCode network sequenceNumber ## 1 347 H US BSOH 391 ## 2 409 A US MSGSN 402 ## ## [[3]] ## id market countryCode network sequenceNumber ## 1 131 H CA TSN2 112 ## 2 33 H CA RDS 132 ## 3 359 A US BSSUN 401 ## ## [[4]] ## id market countryCode network sequenceNumber ## 1 230 H CA RDS2 133 ## 2 294 H CA TSN5 135 ## 3 353 A US BSFL 404 ## ## [[5]] ## id market countryCode network sequenceNumber ## 1 282 N CA SN 21 ## 2 528 A US SN-PIT 375 ## 3 517 H US MNMT 387 ## ## [[6]] ## id market countryCode network sequenceNumber ## 1 2 A US ALT 376 ## 2 361 H US BSN 395 ## 3 363 H US BSWI 403 ## ## [[7]] ## id market countryCode network sequenceNumber ## 1 329 N US ESPN+ 16 ## 2 391 N US HULU 17 ## ## [[8]] ## id market countryCode network sequenceNumber ## 1 289 A CA SNW 34 ## 2 292 H CA TSN3 134 ## ## [[9]] ## id market countryCode network sequenceNumber ## 1 282 N CA SN 101 ## 2 355 A US BSW 379 ## 3 314 H US NBCSCA 384 ``` --- # Working with List-Columns - We can manipulate list-columns with `dplyr::mutate()` - Since elements are lists, we want to use `map()` functions! ```r game_info |> mutate(num_networks = map(tvBroadcasts, nrow)) |> select(num_networks, tvBroadcasts, everything()) ``` ``` ## num_networks ## 1 2 ## 2 2 ## 3 3 ## 4 3 ## 5 3 ## 6 3 ## 7 2 ## 8 2 ## 9 3 ## tvBroadcasts ## 1 375, 31, H, A, US, US, BSSO, NESN, 390, 396 ## 2 347, 409, H, A, US, US, BSOH, MSGSN, 391, 402 ## 3 131, 33, 359, H, H, A, CA, CA, US, TSN2, RDS, BSSUN, 112, 132, 401 ## 4 230, 294, 353, H, H, A, CA, CA, US, RDS2, TSN5, BSFL, 133, 135, 404 ## 5 282, 528, 517, N, A, H, CA, US, US, SN, SN-PIT, MNMT, 21, 375, 387 ## 6 2, 361, 363, A, H, H, US, US, US, ALT, BSN, BSWI, 376, 395, 403 ## 7 329, 391, N, N, US, US, ESPN+, HULU, 16, 17 ## 8 289, 292, A, H, CA, CA, SNW, TSN3, 34, 134 ## 9 282, 355, 314, N, A, H, CA, US, US, SN, BSW, NBCSCA, 101, 379, 384 ## id season gameType gameDate startTimeUTC easternUTCOffset ## 1 2023021202 20232024 2 2024-04-04 2024-04-04T23:00:00Z -04:00 ## 2 2023021203 20232024 2 2024-04-04 2024-04-04T23:00:00Z -04:00 ## 3 2023021204 20232024 2 2024-04-04 2024-04-04T23:00:00Z -04:00 ## 4 2023021205 20232024 2 2024-04-04 2024-04-04T23:00:00Z -04:00 ## 5 2023021206 20232024 2 2024-04-04 2024-04-04T23:00:00Z -04:00 ## 6 2023021207 20232024 2 2024-04-04 2024-04-05T00:00:00Z -04:00 ## 7 2023021208 20232024 2 2024-04-04 2024-04-05T00:00:00Z -04:00 ## 8 2023021209 20232024 2 2024-04-04 2024-04-05T00:00:00Z -04:00 ## 9 2023021210 20232024 2 2024-04-04 2024-04-05T02:30:00Z -04:00 ## venueUTCOffset gameState gameScheduleState ## 1 -04:00 OFF OK ## 2 -04:00 OFF OK ## 3 -04:00 OFF OK ## 4 -04:00 OFF OK ## 5 -04:00 OFF OK ## 6 -05:00 OFF OK ## 7 -05:00 OFF OK ## 8 -05:00 OFF OK ## 9 -07:00 OFF OK ## gameCenterLink ## 1 /gamecenter/bos-vs-car/2024/04/04/2023021202 ## 2 /gamecenter/nyi-vs-cbj/2024/04/04/2023021203 ## 3 /gamecenter/tbl-vs-mtl/2024/04/04/2023021204 ## 4 /gamecenter/fla-vs-ott/2024/04/04/2023021205 ## 5 /gamecenter/pit-vs-wsh/2024/04/04/2023021206 ## 6 /gamecenter/col-vs-min/2024/04/04/2023021207 ## 7 /gamecenter/stl-vs-nsh/2024/04/04/2023021208 ## 8 /gamecenter/cgy-vs-wpg/2024/04/04/2023021209 ## 9 /gamecenter/lak-vs-sjs/2024/04/04/2023021210 ## threeMinRecap neutralSite ## 1 /video/recap-bruins-at-hurricanes-4-4-24-6350293603112 FALSE ## 2 /video/recap-islanders-at-blue-jackets-4-4-24-6350292452112 FALSE ## 3 /video/recap-lightning-at-canadiens-4-4-24-6350291670112 FALSE ## 4 /video/recap-panthers-at-senators-4-4-24-6350292147112 FALSE ## 5 /video/recap-penguins-at-capitals-4-4-24-6350291570112 FALSE ## 6 /video/recap-avalanche-at-wild-4-4-24-6350294078112 FALSE ## 7 /video/recap-blues-at-predators-4-4-24-6350294261112 FALSE ## 8 /video/recap-flames-at-jets-4-4-24-6350295367112 FALSE ## 9 /video/recap-kings-at-sharks-4-4-24-6350301594112 FALSE ## venueTimezone period ## 1 US/Eastern 3 ## 2 US/Eastern 3 ## 3 America/Montreal 3 ## 4 US/Eastern 3 ## 5 US/Eastern 3 ## 6 US/Central 3 ## 7 US/Central 3 ## 8 America/Winnipeg 3 ## 9 US/Pacific 3 ## goals ## 1 1, 1, 1, 2, 3, 02:12, 07:42, 10:46, 15:12, 17:49, 8473419, 8477956, 8478046, 8477404, 8476854, none, none, none, none, empty-net, 8479987, 8475745, 22, 33, M. Geekie, C. Coyle, 8478401, 8478046, 35, 18, P. Zacha, D. Heinen, 8477956, 8478401, 59, 36, D. Pastrnak, P. Zacha, D. Pastrnák, NA, D. Pastrnák, NA, 8476474, 8476869, 21, 30, S. Noesen, B. Skjei, https://assets.nhle.com/mugs/nhl/20232024/BOS/8473419.png, https://assets.nhle.com/mugs/nhl/20232024/BOS/8477956.png, https://assets.nhle.com/mugs/nhl/20232024/BOS/8478046.png, https://assets.nhle.com/mugs/nhl/20232024/CAR/8477404.png, https://assets.nhle.com/mugs/nhl/20232024/BOS/8476854.png, BOS, BOS, BOS, CAR, BOS, 28, 47, 16, 25, 3, 1, 2, 3, 3, 4, 0, 0, 0, 1, 1, ev, ev, ev, pp, ev, https://nhl.com/video/, https://nhl.com/video/bos-car-pastrnak-scores-goal-against-frederik-andersen-6350286516112, https://nhl.com/video/bos-car-heinen-scores-goal-against-frederik-andersen-6350289155112, https://nhl.com/video/bos-car-guentzel-scores-goal-against-jeremy-swayman-6350291485112, NA, 6350287176112, 6350286516112, 6350289155112, 6350291485112, NA, 6350288244112, 6350288559112, 6350289153112, 6350291385112, 6350291928112, 1, 1, 1, 2, 3, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, B. Marchand, D. Pastrnak, D. Heinen, J. Guentzel, H. Lindholm, NA, D. Pastrnák, NA, NA, NA, NA, D. Pastrnák, NA, NA, NA, Brad, David, Danton, Jake, Hampus, Marchand, Pastrnak, Heinen, Guentzel, Lindholm, NA, Pastrnák, NA, NA, NA, NA, Pastrnák, NA, NA, NA ## 2 1, 1, 1, 1, 3, 3, 07:53, 09:45, 13:48, 17:22, 03:21, 19:22, 8478115, 8481716, 8477500, 8480893, 8480865, 8475151, none, none, none, none, none, empty-net, 8477506, 8475151, 12, 21, R. Pulock, K. Palmieri, 8480893, 8480074, 18, 17, K. Marchenko, A. Texier, K. Marcenko, NA, K. Martshenko, NA, K. Marcenko, NA, 8478445, 8481014, 54, 12, M. Barzal, A. Romanov, 8478460, 8482705, 42, 17, Z. Werenski, C. Sillinger, 8478445, 8481014, 55, 13, M. Barzal, A. Romanov, https://assets.nhle.com/mugs/nhl/20232024/NYI/8478115.png, https://assets.nhle.com/mugs/nhl/20232024/CBJ/8481716.png, https://assets.nhle.com/mugs/nhl/20232024/NYI/8477500.png, https://assets.nhle.com/mugs/nhl/20232024/CBJ/8480893.png, https://assets.nhle.com/mugs/nhl/20232024/NYI/8480865.png, https://assets.nhle.com/mugs/nhl/20232024/NYI/8475151.png, NYI, CBJ, NYI, CBJ, NYI, NYI, 9, 18, 32, 21, 9, 25, 1, 1, 2, 2, 3, 4, 0, 1, 1, 2, 2, 2, pp, pp, ev, ev, ev, ev, https://nhl.com/video/nyi-cbj-engvall-scores-goal-against-daniil-tarasov-6350287479112, https://nhl.com/video/nyi-cbj-voronkov-scores-goal-against-new-york-islanders-6350288851112, https://nhl.com/video/nyi-cbj-horvat-scores-goal-against-daniil-tarasov-6350289664112, https://nhl.com/video/nyi-cbj-marchenko-scores-goal-against-ilya-sorokin-6350287829112, https://nhl.com/video/nyi-cbj-dobson-scores-goal-against-jet-greaves-6350292291112, https://nhl.com/video/nyi-cbj-palmieri-scores-goal-against-columbus-blue-jackets-6350291654112, 6350287479112, 6350288851112, 6350289664112, 6350287829112, 6350292291112, 6350291654112, 6350285909112, 6350287593112, 6350287691112, 6350288392112, 6350290529112, 6350291740112, 1, 1, 1, 1, 3, 3, REG, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, 3, P. Engvall, D. Voronkov, B. Horvat, K. Marchenko, N. Dobson, K. Palmieri, NA, NA, NA, K. Marcenko, NA, NA, NA, NA, NA, K. Martshenko, NA, NA, NA, NA, NA, K. Marcenko, NA, NA, Pierre, Dmitri, Bo, Kirill, Noah, Kyle, NA, Dmitrij, NA, NA, NA, NA, NA, Dmitrij, NA, NA, NA, NA, Engvall, Voronkov, Horvat, Marchenko, Dobson, Palmieri, NA, NA, NA, Marcenko, NA, NA, NA, NA, NA, Martshenko, NA, NA, NA, NA, NA, Marcenko, NA, NA ## 3 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 02:37, 09:45, 16:26, 04:42, 07:58, 09:12, 13:18, 17:45, 08:40, 11:51, 19:06, 8476469, 8477426, 8479591, 8476469, 8474564, 8477426, 8479542, 8476453, 8483515, 8481540, 8474564, none, none, none, none, none, none, none, none, none, none, empty-net, 8475848, 8481618, 11, 16, B. Gallagher, A. Newhook, 8478010, 8476453, 41, 89, B. Point, N. Kucherov, NA, N. Kucerov, NA, N. Kutsherov, NA, N. Kucerov, 8477353, 8476856, 3, 7, T. Motte, M. Dumba, 8481618, 8475848, 17, 12, A. Newhook, B. Gallagher, 8478519, 8475177, 23, 6, A. Cirelli, C. de Haan, 8479591, 12, M. Eyssimont, 8478178, 8478519, 25, 24, D. Raddysh, A. Cirelli, 8478010, 8474564, 42, 37, B. Point, S. Stamkos, 8482964, 8476875, 7, 43, A. Xhekaj, M. Matheson, 8480018, 8483515, 40, 28, N. Suzuki, J. Slafkovský, 8476453, 90, N. Kucherov, N. Kucerov, N. Kutsherov, N. Kucerov, https://assets.nhle.com/mugs/nhl/20232024/MTL/8476469.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8477426.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8479591.png, https://assets.nhle.com/mugs/nhl/20232024/MTL/8476469.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8474564.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8477426.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8479542.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8476453.png, https://assets.nhle.com/mugs/nhl/20232024/MTL/8483515.png, https://assets.nhle.com/mugs/nhl/20232024/MTL/8481540.png, https://assets.nhle.com/mugs/nhl/20232024/TBL/8474564.png, MTL, TBL, TBL, MTL, TBL, TBL, TBL, TBL, MTL, MTL, TBL, 15, 21, 11, 16, 33, 22, 24, 43, 16, 22, 34, 0, 1, 2, 2, 3, 4, 5, 6, 6, 6, 7, 1, 1, 1, 2, 2, 2, 2, 2, 3, 4, 4, ev, pp, ev, ev, ev, ev, ev, pp, ev, ev, ev, https://nhl.com/video/tbl-mtl-armia-scores-goal-against-matt-tomkins-6350286300112, https://nhl.com/video/tbl-mtl-paul-scores-goal-against-cayden-primeau-6350287806112, https://nhl.com/video/tbl-mtl-eyssimont-scores-goal-against-cayden-primeau-6350290065112, https://nhl.com/video/tbl-mtl-armia-scores-goal-against-matt-tomkins-6350289711112, https://nhl.com/video/tbl-mtl-stamkos-scores-goal-against-cayden-primeau-6350289810112, https://nhl.com/video/tbl-mtl-paul-scores-goal-against-cayden-primeau-6350290405112, https://nhl.com/video/tbl-mtl-hagel-scores-goal-against-cayden-primeau-6350290698112, https://nhl.com/video/tbl-mtl-kucherov-scores-goal-against-cayden-primeau-6350291598112, https://nhl.com/video/tbl-mtl-slafkovsky-scores-goal-against-matt-tomkins-6350291536112, https://nhl.com/video/tbl-mtl-caufield-scores-goal-against-matt-tomkins-6350292322112, https://nhl.com/video/tbl-mtl-stamkos-scores-goal-against-cayden-primeau-6350291563112, https://nhl.com/fr/video/tbl-mtl-armia-scores-goal-against-tampa-bay-lightning-6350286203112, https://nhl.com/fr/video/tbl-mtl-paul-scores-goal-against-cayden-primeau-6350287888112, https://nhl.com/fr/video/tbl-mtl-eyssimont-scores-goal-against-cayden-primeau-6350287219112, https://nhl.com/fr/video/tbl-mtl-armia-scores-goal-against-tampa-bay-lightning-6350288606112, https://nhl.com/fr/video/tbl-mtl-stamkos-scores-goal-against-cayden-primeau-6350290193112, https://nhl.com/fr/video/tbl-mtl-paul-scores-goal-against-cayden-primeau-6350290283112, https://nhl.com/fr/video/tbl-mtl-hagel-scores-goal-against-cayden-primeau-6350290117112, https://nhl.com/fr/video/tbl-mtl-kucherov-scores-goal-against-cayden-primeau-6350291599112, https://nhl.com/fr/video/tbl-mtl-slafkovsky-scores-goal-against-tampa-bay-lightning-6350293104112, https://nhl.com/fr/video/tbl-mtl-caufield-scores-goal-against-tampa-bay-lightning-6350293214112, https://nhl.com/fr/video/tbl-mtl-stamkos-scores-goal-against-cayden-primeau-6350293025112, 6350286300112, 6350287806112, 6350290065112, 6350289711112, 6350289810112, 6350290405112, 6350290698112, 6350291598112, 6350291536112, 6350292322112, 6350291563112, 6350286203112, 6350287888112, 6350287219112, 6350288606112, 6350290193112, 6350290283112, 6350290117112, 6350291599112, 6350293104112, 6350293214112, 6350293025112, 6350287862112, 6350288761112, 6350287709112, 6350289897112, 6350291170112, 6350289018112, 6350291393112, 6350290615112, 6350290753112, 6350293304112, 6350291948112, 6350285901112, 6350288467112, 6350289169112, 6350290093112, 6350290398112, 6350288541112, 6350289030112, 6350290132112, 6350293201112, 6350290943112, 6350293131112, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, REG, REG, REG, REG, REG, REG, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, J. Armia, N. Paul, M. Eyssimont, J. Armia, S. Stamkos, N. Paul, B. Hagel, N. Kucherov, J. Slafkovský, C. Caufield, S. Stamkos, NA, NA, NA, NA, NA, NA, NA, N. Kucerov, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N. Kutsherov, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N. Kucerov, NA, NA, NA, Joel, Nick, Michael, Joel, Steven, Nick, Brandon, Nikita, Juraj, Cole, Steven, Armia, Paul, Eyssimont, Armia, Stamkos, Paul, Hagel, Kucherov, Slafkovský, Caufield, Stamkos, NA, NA, NA, NA, NA, NA, NA, Kucerov, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, Kutsherov, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, Kucerov, NA, NA, NA ## 4 1, 1, 2, 2, 2, 3, 01:02, 01:37, 02:35, 04:19, 17:56, 03:54, 8476393, 8475179, 8482113, 8477935, 8477933, 8479314, none, none, none, none, none, none, 8479314, 8477935, 58, 19, M. Tkachuk, S. Bennett, 8480185, 8478542, 12, 27, E. Luostarinen, E. Rodrigues, 8480185, 8476393, 13, 6, E. Luostarinen, N. Cousins, 8479314, 8479372, 59, 9, M. Tkachuk, J. Mahura, 8477493, 8475765, 52, 30, A. Barkov, V. Tarasenko, 8477493, 8477933, 53, 36, A. Barkov, S. Reinhart, https://assets.nhle.com/mugs/nhl/20232024/FLA/8476393.png, https://assets.nhle.com/mugs/nhl/20232024/FLA/8475179.png, https://assets.nhle.com/mugs/nhl/20232024/FLA/8482113.png, https://assets.nhle.com/mugs/nhl/20232024/FLA/8477935.png, https://assets.nhle.com/mugs/nhl/20232024/FLA/8477933.png, https://assets.nhle.com/mugs/nhl/20232024/FLA/8479314.png, FLA, FLA, FLA, FLA, FLA, FLA, 6, 1, 11, 19, 53, 24, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0, ev, ev, ev, ev, ev, pp, https://nhl.com/video/, https://nhl.com/video/fla-ott-kulikov-scores-goal-against-joonas-korpisalo-6350288065112, https://nhl.com/video/, https://nhl.com/video/fla-ott-bennett-scores-goal-against-joonas-korpisalo-6350289804112, https://nhl.com/video/fla-ott-reinhart-scores-goal-against-anton-forsberg-6350290042112, https://nhl.com/video/fla-ott-tkachuk-scores-goal-against-anton-forsberg-6350291513112, https://nhl.com/fr/video/fla-ott-cousins-scores-goal-against-joonas-korpisalo-6350285794112, https://nhl.com/fr/video/fla-ott-kulikov-scores-goal-against-joonas-korpisalo-6350288150112, NA, https://nhl.com/fr/video/fla-ott-bennett-scores-goal-against-joonas-korpisalo-6350288031112, https://nhl.com/fr/video/fla-ott-reinhart-scores-goal-against-anton-forsberg-6350290221112, https://nhl.com/fr/video/fla-ott-tkachuk-scores-goal-against-anton-forsberg-6350292096112, 6350288344112, 6350288065112, 6350289889112, 6350289804112, 6350290042112, 6350291513112, 6350285794112, 6350288150112, NA, 6350288031112, 6350290221112, 6350292096112, 6350287573112, 6350286793112, 6350289408112, 6350288998112, 6350290699112, 6350290634112, 6350287955112, 6350286788112, 6350289596112, 6350288029112, 6350289931112, 6350291789112, 1, 1, 2, 2, 2, 3, REG, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, 3, N. Cousins, D. Kulikov, A. Lundell, S. Bennett, S. Reinhart, M. Tkachuk, Nick, Dmitry, Anton, Sam, Sam, Matthew, NA, Dmitrij, NA, NA, NA, NA, NA, Dmitri, NA, NA, NA, NA, NA, Dmitrij, NA, NA, NA, NA, Cousins, Kulikov, Lundell, Bennett, Reinhart, Tkachuk ## 5 1, 1, 2, 3, 3, 01:49, 11:03, 09:08, 06:02, 17:23, 8478854, 8480058, 8478047, 8471214, 8474189, none, none, none, none, empty-net, 8475191, 8474189, 24, 14, R. Smith, L. Eller, 8471724, 8482055, 39, 16, K. Letang, D. O'Connor, 8481703, 8474578, 15, 39, V. Puustinen, E. Karlsson, 8477947, 8482148, 8, 12, S. Milano, H. Lapierre, 8475191, 8471724, 25, 40, R. Smith, K. Letang, https://assets.nhle.com/mugs/nhl/20232024/PIT/8478854.png, https://assets.nhle.com/mugs/nhl/20232024/PIT/8480058.png, https://assets.nhle.com/mugs/nhl/20232024/PIT/8478047.png, https://assets.nhle.com/mugs/nhl/20232024/WSH/8471214.png, https://assets.nhle.com/mugs/nhl/20232024/PIT/8474189.png, PIT, PIT, PIT, WSH, PIT, 1, 2, 17, 27, 15, 1, 2, 3, 3, 4, 0, 0, 0, 1, 1, ev, ev, ev, pp, ev, https://nhl.com/video/pit-wsh-shea-scores-goal-against-charlie-lindgren-6350286005112, https://nhl.com/video/pit-wsh-joseph-scores-goal-against-charlie-lindgren-6350287403112, https://nhl.com/video/pit-wsh-bunting-scores-goal-against-charlie-lindgren-6350290017112, https://nhl.com/video/pit-wsh-ovechkin-scores-goal-against-pittsburgh-penguins-6350292893112, https://nhl.com/video/pit-wsh-eller-scores-goal-against-washington-capitals-6350290953112, 6350286005112, 6350287403112, 6350290017112, 6350292893112, 6350290953112, 6350287770112, 6350287295112, 6350290484112, 6350291630112, 6350290952112, 1, 1, 2, 3, 3, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, R. Shea, P. Joseph, M. Bunting, A. Ovechkin, L. Eller, NA, NA, NA, A. Oveckin, NA, NA, NA, NA, A. Ovetshkin, NA, NA, NA, NA, A. Oveckin, NA, Ryan, P.O, Michael, Alex, Lars, NA, Pierre-Olivier, NA, Alexandr, NA, NA, Pierre-Olivier, NA, NA, NA, NA, Pierre-Olivier, NA, NA, NA, NA, Pierre-Olivier, NA, Aleksandr, NA, NA, Pierre-Olivier, NA, Alexander, NA, NA, Pierre-Olivier, NA, NA, NA, Shea, Joseph, Bunting, Ovechkin, Eller, NA, NA, NA, Oveckin, NA, NA, NA, NA, Ovetshkin, NA, NA, NA, NA, Oveckin, NA ## 6 1, 1, 1, 2, 2, 3, 3, 04:34, 08:05, 12:28, 00:43, 10:10, 06:32, 18:32, 8477476, 8479968, 8477494, 8477494, 8480990, 8477492, 8478420, none, none, none, none, none, none, empty-net, 8471677, 8479999, 13, 37, J. Johnson, C. Mittelstadt, 8479972, 8481422, 2, 3, M. Shaw, J. Lucchini, 8480069, 8477492, 63, 81, C. Makar, N. MacKinnon, 8477492, 8478038, 82, 34, N. MacKinnon, D. Toews, 8478864, 8475692, 47, 46, K. Kaprizov, M. Zuccarello, 8477494, 34, J. Drouin, https://assets.nhle.com/mugs/nhl/20232024/COL/8477476.png, https://assets.nhle.com/mugs/nhl/20232024/MIN/8479968.png, https://assets.nhle.com/mugs/nhl/20232024/COL/8477494.png, https://assets.nhle.com/mugs/nhl/20232024/COL/8477494.png, https://assets.nhle.com/mugs/nhl/20232024/MIN/8480990.png, https://assets.nhle.com/mugs/nhl/20232024/COL/8477492.png, https://assets.nhle.com/mugs/nhl/20232024/COL/8478420.png, COL, MIN, COL, COL, MIN, COL, COL, 14, 5, 16, 17, 2, 48, 40, 1, 1, 2, 3, 3, 4, 5, 0, 1, 1, 1, 2, 2, 2, ev, ev, pp, ev, pp, ev, ev, https://nhl.com/video/col-min-lehkonen-scores-goal-against-filip-gustavsson-6350290388112, https://nhl.com/video/col-min-lettieri-scores-goal-against-justus-annunen-6350289511112, https://nhl.com/video/col-min-drouin-scores-goal-against-filip-gustavsson-6350291298112, https://nhl.com/video/col-min-drouin-scores-goal-against-filip-gustavsson-6350290836112, https://nhl.com/video/col-min-chisholm-scores-goal-against-justus-annunen-6350293301112, https://nhl.com/video/col-min-mackinnon-scores-goal-against-filip-gustavsson-6350293185112, https://nhl.com/video/col-min-rantanen-scores-goal-against-minnesota-wild-6350296125112, 6350290388112, 6350289511112, 6350291298112, 6350290836112, 6350293301112, 6350293185112, 6350296125112, 6350290671112, 6350290775112, 6350290609112, 6350292008112, 6350290361112, 6350292877112, 6350295243112, 1, 1, 1, 2, 2, 3, 3, REG, REG, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, 3, 3, A. Lehkonen, V. Lettieri, J. Drouin, J. Drouin, D. Chisholm, N. MacKinnon, M. Rantanen, Artturi, Vinni, Jonathan, Jonathan, Declan, Nathan, Mikko, Lehkonen, Lettieri, Drouin, Drouin, Chisholm, MacKinnon, Rantanen ## 7 1, 1, 2, 2, 3, 3, 3, 3, 3, 00:31, 07:27, 01:13, 19:29, 04:09, 06:21, 17:45, 18:16, 19:23, 8474600, 8476438, 8476887, 8478463, 8477446, 8482089, 8479385, 8476887, 8476873, none, none, none, none, none, none, none, empty-net, empty-net, 8475158, 8476887, 37, 44, R. O'Reilly, F. Forsberg, 8480023, 52, R. Thomas, 8474679, 8475158, 47, 38, G. Nyquist, R. O'Reilly, 8474679, 8482146, 48, 19, G. Nyquist, L. Evangelista, 8480748, 15, K. Sherwood, 8475753, 8476792, 27, 34, J. Faulk, T. Krug, 8475753, 8477402, 28, 33, J. Faulk, P. Buchnevich, NA, P. Bucnevic, NA, P. Butshnevitsh, NA, P. Bucnevic, 8474679, 8474151, 49, 26, G. Nyquist, R. McDonagh, https://assets.nhle.com/mugs/nhl/20232024/NSH/8474600.png, https://assets.nhle.com/mugs/nhl/20232024/STL/8476438.png, https://assets.nhle.com/mugs/nhl/20232024/NSH/8476887.png, https://assets.nhle.com/mugs/nhl/20232024/NSH/8478463.png, https://assets.nhle.com/mugs/nhl/20232024/NSH/8477446.png, https://assets.nhle.com/mugs/nhl/20232024/STL/8482089.png, https://assets.nhle.com/mugs/nhl/20232024/STL/8479385.png, https://assets.nhle.com/mugs/nhl/20232024/NSH/8476887.png, https://assets.nhle.com/mugs/nhl/20232024/NSH/8476873.png, NSH, STL, NSH, NSH, NSH, STL, STL, NSH, NSH, 20, 26, 42, 5, 12, 27, 26, 43, 7, 0, 1, 1, 1, 1, 2, 3, 3, 3, 1, 1, 2, 3, 4, 4, 4, 5, 6, ev, ev, pp, pp, ev, ev, pp, ev, sh, https://nhl.com/video/stl-nsh-josi-scores-goal-against-jordan-binnington-6350288902112, https://nhl.com/video/stl-nsh-saad-scores-goal-against-juuse-saros-6350290208112, https://nhl.com/video/stl-nsh-forsberg-scores-goal-against-jordan-binnington-6350290645112, https://nhl.com/video/stl-nsh-beauvillier-scores-goal-against-st-louis-blues-6350291468112, https://nhl.com/video/stl-nsh-mccarron-scores-goal-against-jordan-binnington-6350294040112, https://nhl.com/video/stl-nsh-neighbours-scores-goal-against-juuse-saros-6350295217112, https://nhl.com/video/stl-nsh-kyrou-scores-goal-against-nashville-predators-6350295347112, NA, NA, 6350288902112, 6350290208112, 6350290645112, 6350291468112, 6350294040112, 6350295217112, 6350295347112, NA, NA, 6350287725112, 6350290787112, 6350292196112, 6350292835112, 6350294632112, 6350294542112, 6350294870112, 6350294472112, 6350294069112, 1, 1, 2, 2, 3, 3, 3, 3, 3, REG, REG, REG, REG, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, 3, 3, 3, 3, R. Josi, B. Saad, F. Forsberg, A. Beauvillier, M. McCarron, J. Neighbours, J. Kyrou, F. Forsberg, M. Jankowski, Roman, Brandon, Filip, Anthony, Michael, Jake, Jordan, Filip, Mark, Josi, Saad, Forsberg, Beauvillier, McCarron, Neighbours, Kyrou, Forsberg, Jankowski ## 8 1, 1, 1, 2, 2, 3, 3, 04:35, 12:59, 14:56, 10:34, 15:35, 08:44, 18:56, 8477346, 8480014, 8477940, 8482624, 8475726, 8480014, 8480014, none, none, none, none, none, none, empty-net, 8476456, 8483808, 36, 19, J. Huberdeau, A. Kuzmenko, 8478398, 8477504, 24, 53, K. Connor, J. Morrissey, 8482149, 19, C. Perfetti, 8477346, 29, M. Weegar, 8476480, 8477940, 24, 33, V. Namestnikov, N. Ehlers, V. Namestnikov, NA, 8477504, 8480145, 54, 24, J. Morrissey, N. Pionk, NA, N.Pionk, NA, N.Pionk, NA, N.Pionk, NA, N.Pionk, NA, N.Pionk, 8477497, 8476460, 31, 43, S. Monahan, M. Scheifele, https://assets.nhle.com/mugs/nhl/20232024/CGY/8477346.png, https://assets.nhle.com/mugs/nhl/20232024/WPG/8480014.png, https://assets.nhle.com/mugs/nhl/20232024/WPG/8477940.png, https://assets.nhle.com/mugs/nhl/20232024/CGY/8482624.png, https://assets.nhle.com/mugs/nhl/20232024/WPG/8475726.png, https://assets.nhle.com/mugs/nhl/20232024/WPG/8480014.png, https://assets.nhle.com/mugs/nhl/20232024/WPG/8480014.png, CGY, WPG, WPG, CGY, WPG, WPG, WPG, 19, 17, 23, 3, 31, 18, 19, 1, 1, 1, 2, 2, 2, 2, 0, 1, 2, 2, 3, 4, 5, pp, pp, ev, ev, pp, ev, ev, https://nhl.com/video/cgy-wpg-weegar-scores-goal-against-connor-hellebuyck-6350288743112, https://nhl.com/video/cgy-wpg-vilardi-scores-goal-against-dustin-wolf-6350291303112, https://nhl.com/video/cgy-wpg-ehlers-scores-goal-against-dustin-wolf-6350291596112, https://nhl.com/video/cgy-wpg-miromanov-scores-goal-against-connor-hellebuyck-6350292662112, https://nhl.com/video/cgy-wpg-toffoli-scores-goal-against-dustin-wolf-6350292149112, https://nhl.com/video/cgy-wpg-vilardi-scores-goal-against-dustin-wolf-6350293068112, https://nhl.com/video/cgy-wpg-vilardi-scores-goal-against-calgary-flames-6350294372112, 6350288743112, 6350291303112, 6350291596112, 6350292662112, 6350292149112, 6350293068112, 6350294372112, 6350289428112, 6350289340112, 6350290046112, 6350294312112, 6350293018112, 6350295127112, 6350295930112, 1, 1, 1, 2, 2, 3, 3, REG, REG, REG, REG, REG, REG, REG, 3, 3, 3, 3, 3, 3, 3, M. Weegar, G. Vilardi, N. Ehlers, D. Miromanov, T. Toffoli, G. Vilardi, G. Vilardi, MacKenzie, Gabriel, Nikolaj, Daniil, Tyler, Gabriel, Gabriel, Weegar, Vilardi, Ehlers, Miromanov, Toffoli, Vilardi, Vilardi ## 9 1, 1, 3, 10:55, 11:13, 18:08, 8477960, 8480851, 8480011, none, none, none, 8481606, 8479400, 20, 24, J. Spence, P. Dubois, 8475798, 8482667, 40, 25, M. Granlund, W. Eklund, https://assets.nhle.com/mugs/nhl/20232024/LAK/8477960.png, https://assets.nhle.com/mugs/nhl/20232024/LAK/8480851.png, https://assets.nhle.com/mugs/nhl/20232024/SJS/8480011.png, LAK, LAK, SJS, 25, 1, 8, 1, 2, 2, 0, 0, 1, ev, ev, ev, https://nhl.com/video/lak-sjs-kempe-scores-goal-against-san-jose-sharks-6350295356112, https://nhl.com/video/lak-sjs-thomas-scores-goal-against-mackenzie-blackwood-6350296050112, https://nhl.com/video/lak-sjs-kostin-scores-goal-against-los-angeles-kings-6350298706112, 6350295356112, 6350296050112, 6350298706112, 6350296339112, 6350294379112, 6350300766112, 1, 1, 3, REG, REG, REG, 3, 3, 3, A. Kempe, A. Thomas, K. Kostin, Adrian, Akil, Klim, Kempe, Thomas, Kostin ## threeMinRecapFr ## 1 <NA> ## 2 <NA> ## 3 /fr/video/recap-lightning-at-canadiens-4-4-24-6350292258112 ## 4 /fr/video/recap-panthers-at-senators-4-4-24-6350293225112 ## 5 <NA> ## 6 <NA> ## 7 <NA> ## 8 <NA> ## 9 <NA> ## condensedGame ## 1 <NA> ## 2 <NA> ## 3 <NA> ## 4 <NA> ## 5 <NA> ## 6 <NA> ## 7 <NA> ## 8 /video/condensed-game-flames-at-jets-4-4-24-6350294175112 ## 9 <NA> ## venue.default awayTeam.id awayTeam.abbrev awayTeam.score ## 1 PNC Arena 6 BOS 4 ## 2 Nationwide Arena 2 NYI 4 ## 3 Centre Bell 14 TBL 7 ## 4 Canadian Tire Centre 13 FLA 6 ## 5 Capital One Arena 5 PIT 4 ## 6 Xcel Energy Center 21 COL 5 ## 7 Bridgestone Arena 19 STL 3 ## 8 Canada Life Centre 20 CGY 2 ## 9 SAP Center at San Jose 26 LAK 2 ## awayTeam.sog ## 1 28 ## 2 41 ## 3 35 ## 4 31 ## 5 24 ## 6 36 ## 7 47 ## 8 33 ## 9 27 ## awayTeam.logo ## 1 https://assets.nhle.com/logos/nhl/svg/BOS_20232024_light.svg ## 2 https://assets.nhle.com/logos/nhl/svg/NYI_light.svg ## 3 https://assets.nhle.com/logos/nhl/svg/TBL_light.svg ## 4 https://assets.nhle.com/logos/nhl/svg/FLA_light.svg ## 5 https://assets.nhle.com/logos/nhl/svg/PIT_light.svg ## 6 https://assets.nhle.com/logos/nhl/svg/COL_light.svg ## 7 https://assets.nhle.com/logos/nhl/svg/STL_light.svg ## 8 https://assets.nhle.com/logos/nhl/svg/CGY_light.svg ## 9 https://assets.nhle.com/logos/nhl/svg/LAK_20192020-20232024_light.svg ## awayTeam.name.default homeTeam.id homeTeam.abbrev homeTeam.score homeTeam.sog ## 1 Bruins 12 CAR 1 29 ## 2 Islanders 29 CBJ 2 27 ## 3 Lightning 8 MTL 4 30 ## 4 Panthers 9 OTT 0 30 ## 5 Penguins 15 WSH 1 31 ## 6 Avalanche 30 MIN 2 46 ## 7 Blues 18 NSH 6 31 ## 8 Flames 52 WPG 5 45 ## 9 Kings 28 SJS 1 16 ## homeTeam.logo ## 1 https://assets.nhle.com/logos/nhl/svg/CAR_light.svg ## 2 https://assets.nhle.com/logos/nhl/svg/CBJ_light.svg ## 3 https://assets.nhle.com/logos/nhl/svg/MTL_light.svg ## 4 https://assets.nhle.com/logos/nhl/svg/OTT_light.svg ## 5 https://assets.nhle.com/logos/nhl/svg/WSH_secondary_light.svg ## 6 https://assets.nhle.com/logos/nhl/svg/MIN_light.svg ## 7 https://assets.nhle.com/logos/nhl/svg/NSH_light.svg ## 8 https://assets.nhle.com/logos/nhl/svg/WPG_light.svg ## 9 https://assets.nhle.com/logos/nhl/svg/SJS_20082009-20232024_light.svg ## homeTeam.name.default homeTeam.name.fr clock.timeRemaining ## 1 Hurricanes <NA> 00:00 ## 2 Blue Jackets <NA> 00:00 ## 3 Canadiens <NA> 00:00 ## 4 Senators Sénateurs 00:00 ## 5 Capitals <NA> 00:00 ## 6 Wild <NA> 00:00 ## 7 Predators <NA> 00:00 ## 8 Jets <NA> 00:00 ## 9 Sharks <NA> 00:00 ## clock.secondsRemaining clock.running clock.inIntermission ## 1 0 FALSE FALSE ## 2 0 FALSE FALSE ## 3 0 FALSE FALSE ## 4 0 FALSE FALSE ## 5 0 FALSE FALSE ## 6 0 FALSE FALSE ## 7 0 FALSE FALSE ## 8 0 FALSE FALSE ## 9 0 FALSE FALSE ## periodDescriptor.number periodDescriptor.periodType ## 1 3 REG ## 2 3 REG ## 3 3 REG ## 4 3 REG ## 5 3 REG ## 6 3 REG ## 7 3 REG ## 8 3 REG ## 9 3 REG ## periodDescriptor.maxRegulationPeriods gameOutcome.lastPeriodType ## 1 3 REG ## 2 3 REG ## 3 3 REG ## 4 3 REG ## 5 3 REG ## 6 3 REG ## 7 3 REG ## 8 3 REG ## 9 3 REG ``` --- # Recap! `purrr` gives us a bit cleaner/more consistent way to apply functions to objects - Lots of additional helper functions - Use `apply()` family or `purrr` to improve your code!