Repérer les personnes influentes

Programmation fonctionnelle intermédiaire avec purrr

Colin Fay

Data Scientist at ThinkR

map_at()

map_at() à un endroit précis :

my_list <- list(
  a = 1:10, 
  b = 1:100, 
  c = 12)
map_at(.x = my_list, .at = "b", .f = sum)
$a
 [1]  1  2  3  4  5  6  7  8  9 10

$b
[1] 5050

$c
[1] 12
Programmation fonctionnelle intermédiaire avec purrr

negate()

Inversion d'un prédicat :

not_character <- negate(is.character)
my_list <- list(
  a = 1:10, 
  b = "a", 
  c = iris)
map(my_list, not_character)
$a
[1] TRUE

$b
[1] FALSE

$c
[1] TRUE
Programmation fonctionnelle intermédiaire avec purrr

Passons à la pratique !

Programmation fonctionnelle intermédiaire avec purrr

Preparing Video For Download...