[R-pkg-devel] Best way to cache a dataframe available for all functions in a package
X FiM
x||m@|| @end|ng |rom gm@||@com
Fri Nov 26 14:16:11 CET 2021
Dear all,
I am writing a package that needs to load some data from a URL and have
such data (meta data) available when using other functions in the package,
and I would like some advice on how to properly manage such situation.
My first guess would be to create a function to downloads that meta data,
and make this function run when loading the package. I am even familiar
with this, and I could manage.
But the second part, making this sort of data frame available for other
functions in the package, how can I achieve it? Of course I can call the
function that downloads and prepares the data at every use of the other
functions, but that would mean connecting to the Internet again and again.
So, in other words, is there a way to "cache" into memory a data frame
(without having to create an object)?
How could I achieve such thing? What are the kind of keywords that I need
to use when looking for help?
Thank you very much,
--
Xavier
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list