I tried to load my R workspace and received this error:
Error: bad restore file magic number (file may be corrupted) -- no data loaded In addition: Warning message: file ‘WORKSPACE_Wedding_Weekend_September’ has magic number '#gets' Use of save versions prior to 2 is deprecated
I'm not particularly interested in the technical details, but mostly in how I caused it and how I can prevent it in the future. Here's some notes on the situation:
Unfortunately, the error “bad restore file magic number (file may be corrupted) — no data loaded” was returned. The reason for this is that the load function is not suited for rds files.
The magic number comes from UNIX-type systems where the first few bytes of a file held a marker indicating the file type. This error indicates you are trying to load a non-valid file type into R. For some reason, R no longer recognizes this file as an R workspace file.
I got that error when I accidentally used load()
instead of source()
or readRDS()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With