The cause of “bad magic number” error when loading a workspace and how to avoid it?

后端 未结 9 1293
自闭症患者
自闭症患者 2020-11-29 05:54

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 m         


        
9条回答
  •  伪装坚强ぢ
    2020-11-29 06:27

    If you are working with devtools try to save the files with:

    devtools::use_data(x, internal = TRUE)
    

    Then, delete all files saved previously.

    From doc:

    internal If FALSE, saves each object in individual .rda files in the data directory. These are available whenever the package is loaded. If TRUE, stores all objects in a single R/sysdata.rda file. These objects are only available within the package.

提交回复
热议问题