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

cache bug #192

Closed eribul closed 7 years ago

eribul commented 7 years ago

I created a project with older version of ProjectTemplate and it worked fine. I then updated the package and got the error message bellow running cache on an object that was already cached. The problem was solved by first removing the old cached object and then rerunning the cache function again (then a .hash file was created along with hthe cached file etc and everything seems to be in order).

Error in if (stored$hash["VAR", ]$hash == genv.hash["VAR", ]$hash) { : 
  argument is of length zero
eribul commented 7 years ago

BTW: new version I updated to is 0.7

connectedblue commented 7 years ago

Thanks for reporting @eribul - that is definitely a bug. The new caching mechanism has new information in a .hash file as you discovered, but the user shouldn't be exposed to that.

I'll look into this in more detail. I think the fix is to do some work in migrate.project to fix this automatically.

Can you tell me: did you run the migrate.project() command after you upgraded to the latest version of ProjectTemplate?

connectedblue commented 7 years ago

Fix submitted to address this issue #194

KentonWhite commented 7 years ago

@eribul The fix has been merged into master. I'm closing this issue and if the fix doesn't work for you please feel free to reopen!