purrr is a walk() in the park

Nền tảng Lập trình Hàm với purrr

Auriel Fournier

Instructor

Why walk()?

short_list <- list(-10, 1, 10)
short_list
[[1]]
[1] -10

[[2]]
[1] 1

[[3]]
[1] 10
walk(short_list, print)
[1] -10
[1] 1
[1] 10
Nền tảng Lập trình Hàm với purrr

Plots, the normal way

plist
[[1]]

[[2]]

Scatter plot printed with walk()

Bar plot printed with walk()

Nền tảng Lập trình Hàm với purrr

walk() with plots

walk(plist, print)

Scatter plot printed with walk()

Bar plot printed with walk()

Nền tảng Lập trình Hàm với purrr

Let's purrr-actice!

Nền tảng Lập trình Hàm với purrr

Preparing Video For Download...