Stepping through a pipeline with intermediate results

前端 未结 5 1642
梦谈多话
梦谈多话 2021-01-01 19:50

Is there a way to output the result of a pipeline at each step without doing it manually? (eg. without selecting and running only the selected chunks)

I ofte

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-01 20:46

    Add print:

    mtcars %>% 
      group_by(cyl) %>% 
      print %>% 
      sample_frac(0.1) %>% 
      print %>% 
      summarise(res = mean(mpg))
    

提交回复
热议问题