-
-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Dear Yihui,
I appreciate xfun's straightforward caching function cache_rds.
Today, however, I realised that there is a hidden platform dependency because the hash is calculated using MD5 on objects that are first written out as RDS files. In my concrete case, I have a list of objects that serves as a hash. Saving this list as RDS gives different file objects on Mac and Linux (due to locale settings that might differ). Hence, the caching erroneously fails when I switch from one platform to the other.
My question:
Is it possible to avoid saving the hash objects as RDS-files to disk within cache_rds (i.e., within md5_obj) because it can make the caching platform dependent?
I have thought about something in the line of rlang::hash which operates directly on R-objects (using only RAM).
Thanks!
-m