Skip to content

Memoised pipe? #137

@StaffanBetner

Description

@StaffanBetner

Is it possible to memoise the magrittr pipe %>%?

Just as-is it doesn't seem to work, see reprex:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(magrittr)
library(memoise)

`%>%` <- memoise(`%>%`)
mtcars %>% mutate(x = mpg)
#> Error in mutate(x = mpg): object 'mpg' not found

Created on 2022-06-17 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions