Can you identify the evaluation issue in this tidyverse pipeline?

23 views Asked by At

Of the three blocks below, can anyone explain how to use the . placeholder in the last example? It won't run. I assumed it was an evaluation issue, but I can't quite identify it.

library(tidyverse)
library(magrittr)

#Lazy: Doesn't run
iris%>%
  map(.x = .$Sepal.Length,
      .f = function(.x){
        print(.x)
      })

#Eager: Doesn't run
iris%!>%
  map(.x = .$Sepal.Length,
      .f = function(.x){
        print(.x)
      })

#Runs
map(.x = iris$Sepal.Length,
    .f = function(.x){
      print(.x)
    })

0

There are 0 answers