numbats / numbathackathon

Repository for the NUMBAT Hackathon, 2020
1 stars 0 forks source link

roam: Remote Objects with Activebinding Magic #28

Open mitchelloharawild opened 1 year ago

mitchelloharawild commented 1 year ago

A package like pins which allows you or other packages to include potentially updating sources of data without exceeding the 5MB limit.

Example:

the_data
#> The `the_data` object is not available locally, would you like to download it?
#> 1. Yes
#> 2. No

After obtaining the data for the object, it works as a standard object.

This is possible using the little used feature of R known as 'active bindings'. Essentially regular 'objects' like the_data are treated as functions. The {roam} package will help to create an 'active binding' function that does:

  1. Checks if the object is available locally
  2. If the data is not available, prompt the user to download it during interactive sessions or directly download it if an option is set.
  3. Load the object from the local cache and return it.
mitchelloharawild commented 1 year ago

More info here: https://github.com/numbats/numbathackathon/issues/3#issuecomment-587966989

cynthiahqy commented 1 year ago

I'm up for writing documentation and things when needed

dicook commented 1 year ago

https://github.com/mitchelloharawild/roam