Skip to content

omit_args does not work with default values #159

@venpopov

Description

@venpopov
library(memoise)

f <- function(n, x = 0) {
  rnorm(n)
}

fm <- memoise(f, omit_args = "x")

fm(1)
#> [1] -0.008028243
fm(1)
#> [1] -0.008028243
fm(1, x = 0)
#> [1] -0.8423555
fm(1, x = 0)
#> [1] -0.8423555
fm(1, x = 1)
#> [1] -0.8423555
fm(1)
#> [1] -0.008028243

Created on 2026-02-13 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions