KentonWhite / ProjectTemplate

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

Clear objects from Global Env as well as cache during clear.cache() #172

Closed connectedblue closed 7 years ago

connectedblue commented 7 years ago

This PR fixes a bug in the clear.cache() function.

The reason for issuing a clear.cache() command is that you want the variable to be recalculated during a load.project() perhaps because a data file has changed (and the new result would be re-cached again after)

Currently, when calling the function, the cache is cleared correctly, but the object remains in memory meaning that if load.project() is called, data loading is skipped over. The user would have to issue a clear() command as well to get the desired outcome.

This PR always clears any objects from memory as well as the cache, forcing a reload during the next load.project().