KentonWhite / ProjectTemplate

A template utility for R projects that provides a skeletal project.
http://projecttemplate.net
GNU General Public License v3.0
622 stars 159 forks source link

Bug Fix: Missing hash file causes failure in subsequent cache() operation #194

Closed connectedblue closed 7 years ago

connectedblue commented 7 years ago

This big was raised by @eribul in #192. It was reproducible exactly as described in the issue.

The cause is because there should always be a .hash file present in the cache drectory alongside the .RData file.

The solution is as follows: If the hash is missing, either because there was a previously cached variable made under an old version of ProjectTemplate, or it may have been inadvertently deleted, then the associated cache file is also removed when a cache command is issued again. This ensures a successful recache and a consistent cache directory again.

A test set has been added to check for this use case.

Note that there are a large number of man files re-generated when I rebuilt the package for this submission. These were not as a result of a change made by me under this PR. I suspect that an upgrade to ROxygen to v6.0 may have forced a recompile. Either way, the documentation is up to date now, so it's not a big deal.

KentonWhite commented 7 years ago

Thanks!