tags:

views:

33

answers:

1

Is it possible to update a dataset in a local, installed 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?

+1  A: 

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.

Dirk Eddelbuettel
Dirk - thanks. The goal is to allow users who have the package installed to update the dataset without installing a new version of the package. I may just replace the dataset with a function that pulls in the most recent version of the data.
Greg
Right, esp. if you have shared resources (NFS, CIFS, web server, ...) you all can access.
Dirk Eddelbuettel