Update the dataset in an installed package
Is it possible to update a dataset in a local, ins开发者_开发知识库talled package?
A package that I maintain has a dataset based on periodically-updated data. I would like to update the local version of my dataset and save the changes back to the package such that next time I load the data, i.e. data(xxx)
, the updated version of the dataset will load.
In the medium and long term I will update the package and then upload a new version to CRAN, but I'm looking for a short term solution.
If it is possible, how would I do it?
You could
by updating the source and re-installing, yes. Preferably with a new distinctive version number.
by forcefully overwriting it, possibly. Not the proper way to do it.
What I would try to do is to put a mechanism to acquire this data in the package, but separate the (changing ?) data from the code.
Packages are not first and foremost a means to direct data acquisition, in particular for changing data sets. Most packages include fixed data to demonstrate or illustrate a method or implementation.
精彩评论