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 had download() function in the readtext package, whose primary function is to save downloaded files locally as cache files to avoid downloading of the same files.
However, I decided to move that function to somewhere else because the function is not specifically about textual data. The new home for the function can be a new single function package downloadCache, but, before start making the package, I want to know if you have a plan to add a similar function to simpleCache.
I am also happy to issue a PR if you think that function fits well to your package.
The text was updated successfully, but these errors were encountered:
I removed it because I never had it 100% working and I didn't want to have non-working cruft in the release package when we submitted to CRAN.
So, I would welcome a PR with a fully functional version of that function. I have a few thoughts first about how it would work:
the function should go through the simpleCache function for the actual caching part so we don't duplicate code.
would it be better to just modify the simpleCache function so that it can take either an instruction (like it does now) or a url (which it would download)?
how do you deal with different file types in the given URL? In my original version I was just using read.table to read in that file, but that only works for table-like files. in theory the url could be anything right? so would you pipe that through your readtext function? in that case, we could add readtext to the enhances section of simpleCache, and then throw an error if it is not installed and the user uses the url argument?
Hi @nsheff interesting to hear about the history of the package. I was thinking to use simpleCache as underlying caching function, and define a special behavior for a URL to that function makes sense. As for the file types, I had the same problem in readtext, but made the function to return path to cached file instead of file content so that appropriate IO function can be used. If it does not sound good, we could limit the supported file types to either RDS or RDA.
I had
download()
function in the readtext package, whose primary function is to save downloaded files locally as cache files to avoid downloading of the same files.However, I decided to move that function to somewhere else because the function is not specifically about textual data. The new home for the function can be a new single function package downloadCache, but, before start making the package, I want to know if you have a plan to add a similar function to simpleCache.
I am also happy to issue a PR if you think that function fits well to your package.
The text was updated successfully, but these errors were encountered: