The function should check if the file exists, and if it does not, evaluate the code.
Afterwards, it checks if the requested file has been created, and issues a warning if it has not been.
To make sure that the file is updated on code change, we can do the following:
A symlink to the output file could be created, e.g..cache-R/data:table.csv_@_HASH.link - for the first example above.
This way, if we change the download URL, the download.file expr should be evaluated again.
Is something like this within the scope of a package?
Would you accept a pull request?
Hi @ivakru, I think this would be a very useful addition the the package. I often need to cache files in this way and it will be handy to have this part of the package. I'll review your pull requests.
Hello.
Thank you for this nice package.
I would like to implement a feature that evaluated code to create a file. Use cases are downloading files and saving plots.
I would like to implement an interface like this:
The function should check if the file exists, and if it does not, evaluate the code. Afterwards, it checks if the requested file has been created, and issues a warning if it has not been.
To make sure that the file is updated on code change, we can do the following: A symlink to the output file could be created, e.g.
.cache-R/data:table.csv_@_HASH.link
- for the first example above. This way, if we change the download URL, thedownload.file
expr should be evaluated again.Is something like this within the scope of a package? Would you accept a pull request?