Basically all answers require restarting R to resolve the issue, but I found myself in an environment where I really didn't want to restart R.
I am posting here a somewhat hack-ish solution suggested by Jim Hester in a bug report about the lazy-load corruption issue.
The gist of it is that the package may have some vestigial S3 methods listed in session's .__S3MethodsTable__.
environment. I don't have a very systematic way of identifying which S3 methods in that environment come from where, but I think a good place to start is the print
methods, and looking for S3method
registrations in the package's NAMESPACE
.
You can then remove those S3 methods from the .__S3MethodsTable__.
environment and try again, e.g.
rm(list="print.object", envir = get(".__S3MethodsTable__.", envir = baseenv()))
You may also need to unload some DLLs if some new messages come up like
no such symbol glue_ in package /usr/local/lib/R/site-library/glue/libs/glue.so
You can check getLoadedDLLs()
to see which such files are loaded in your session. In the case of glue
here, the following resolved the issue:
library.dynam.unload('glue', '/usr/local/lib/R/site-library/glue')
preprocessing
should not be at top-level, move it toinst/preprocessing
. And you should delete the read-and-delete-me file. Otherwise, it just seems like your .rdb is corrupt.. like the error says. Plus you didn't specify how you created it – Fermata