Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider memoisation or some kind of caching mechanism? #29

Open
njtierney opened this issue Oct 21, 2024 · 1 comment
Open

Consider memoisation or some kind of caching mechanism? #29

njtierney opened this issue Oct 21, 2024 · 1 comment

Comments

@njtierney
Copy link
Owner

njtierney commented Oct 21, 2024

Just to make sure we don't need to download the data each and every time.

One approach is to consider memoisation to manage the downloads of files so we don't download each time

Another approach to this could be to save it in the pkg user directory:

get_pkg_user_dir <- function() {
  pkg_user_dir <- tools::R_user_dir("ozroaddeaths")
  if (!dir.exists(pkg_user_dir)) {
    dir.create(pkg_user_dir, recursive = TRUE)
  }
  pkg_user_dir
}

and then do some sort of cache invalidation magic to check if the data needs to be updated

@njtierney njtierney changed the title Consider memoisation? Consider memoisation or some kind of caching mechanism? Oct 21, 2024
@njtierney
Copy link
Owner Author

See https://blog.r-hub.io/2020/03/12/user-preferences/ for discussion on user persistent data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant