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

后端 未结 9 1284
自闭症患者
自闭症患者 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:11

    Assuming your file is named "myfile.ext"

    If the file you're trying to load is not an R-script, for which you would use

    source("myfile.ext")
    

    you might try the readRDSfunction and assign it to a variable-name:

    my.data <- readRDS("myfile.ext")
    

提交回复
热议问题