The cause of “bad magic number” error when loading a workspace and how to avoid it? December 22, 2022 by Tarik I got that error when I accidentally used load() instead of source() or readRDS().