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
I too am running into this issue. Is there a vignette on using memoise with a package's function?
Edit: I believe this might be because the function that I was calling had additional function calls inside of it that themselves were not memoised. I memoised additional functions that were being called and that has seemingly resolved the issue.
I'm making a package with RStudio+roxygen2, and I would like to memoise a function that reads from a zipped file or URL and returns a value.
What I've tried so far (inspired from other CRAN packages):
usethis::use_package("memoise")
2 )Define a function like this:
Check and Build the package with Rstudio
Check if function is memoised
> memoise::is.memoised(hello)
[1] TRUE
Run an example
> hello(2)
[1] 3
Check if result is cached:
> memoise::has_cache(hello)(2)
[1] FALSE
So is.memoise reports the function as memoised, but it doesn't seem to cache the result.
What's the correct way of memoising a function in package in this way?
The text was updated successfully, but these errors were encountered: