I have a function in a package that needs to download a dataset over the internet (it is not practical to store it internally due to package size considerations / CRAN requirements).
The dataset (it is a shapefile -
sf data frame) remains the same each call. While the size is not that huge - megabytes, not gigabytes - it seems a wasteful approach from bandwidth considerations.
Is there a practical way to cache the result, i.e. download once and then store it locally? Ideally an approach that would be OS independent...
Thanks for advice!