3

I tried to load data to my R working directory and receive this error:

Error: bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘classize.RData’ has magic number 'RDX3'
  Use of save versions prior to 2 is deprecated

I googled it and tried many options, unsuccessfully.

  1. My Rstudio version is: 1.2.5033 (The error was happening before updating as well)
  2. I create a new project, in the new directory, I put the data file
  3. The data file is "classize.RData"
  4. I have another alternative which is "classize.RDS" with the sugesstion to use readRDS(file = "classize.RDS"). When using this command, I receive that error:
  cannot read workspace version 3 written by R 3.6.1; need R 3.5.0 or newer

This is in the context of a statistical course at university and my teacher assistant is unable to help me out, and whitout resolving this issue, I cannot move forward in the resolution of the needed exrecices. So please, couly you help me resolve that problem.

ps: all the students have access to the same data, It's just for me that it's not working, therefore the file should not be corrupted.

CMH
  • 31
  • 3
  • What is the code that you run to load the data? – Georgery Feb 21 '20 at 08:54
  • Also, it kind of suggests that you need to update your R. If this is the case, you can just google, how to do it. – Georgery Feb 21 '20 at 08:56
  • 1
    Use source() or readRDS() while loading the data, as suggested in the post https://stackoverflow.com/questions/12463583/the-cause-of-bad-magic-number-error-when-loading-a-workspace-and-how-to-avoid Also, upload R to the latest version – maarvd Feb 21 '20 at 08:57
  • I just updated my R and the issue keeps happening. I tried : - readRDS(file = "classize.RDS") - object <-readRDS("classize.RDS") - load("/Users/charles/Documents/Uni/4th sremester/stat2/project") load("classize.RData") Doesn't work... – CMH Feb 21 '20 at 09:01
  • Thank you for the link to this previous post, nonetheless I already saw it and tried everything suggested without any success... – CMH Feb 21 '20 at 09:06
  • What version of R are you using? You need version 3.5.0 or newer, as the message says. The version of RStudio is independent of the version of R: RStudio is just the editor and front end, R does the work of loading the file. – user2554330 Feb 21 '20 at 10:36
  • It was indeed that. My version of R wasn't up to date and updating it resolved the issue. Thank you @user2554330 for pointing out this difference between R and RStudio. – CMH Feb 21 '20 at 11:31

0 Answers0