You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't necessarily a problem with memoise at all, but rather a warning that might be worth giving to folks who read about the package.
If someone tries to memoise a function that includes any sort of randomization in it, their outputs will not be random if the inputs are identical, and it could be really hard to tell just by looking at the results. Here's a simple example:
rnorm_mem <- memoise(rnorm)
x <- rnorm_mem(10)
y <- rnorm_mem(10)
all.equal(x,y)
#> [1] TRUE
It seems pretty obvious, but I could definitely see someone getting a little trigger-happy with memoise and making this mistake without realizing it.
The text was updated successfully, but these errors were encountered:
Hey there,
This isn't necessarily a problem with memoise at all, but rather a warning that might be worth giving to folks who read about the package.
If someone tries to memoise a function that includes any sort of randomization in it, their outputs will not be random if the inputs are identical, and it could be really hard to tell just by looking at the results. Here's a simple example:
It seems pretty obvious, but I could definitely see someone getting a little trigger-happy with memoise and making this mistake without realizing it.
The text was updated successfully, but these errors were encountered: