0

I was trying to load a .RData file. And got the following error:

ReadItem: unknown type 64 perhaps written by later version of R

I hit the same error on both Rstudio Server and my Local Rstudio.

Here is my session info for Rstudio Server: R version 3.4.2 (2017-09-28) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux Server 7.6 (Maipo)

Matrix products: default BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

Here is my session info for my local Rstudio: R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

Chenying Gao
  • 310
  • 4
  • 14
  • 1
    `.Rdata` files are not cross-major-version interchangeable. You need to redo the code that created whatever data might be in that work-space image. – IRTFM Jul 16 '19 at 22:19

1 Answers1

1

I have been getting this error even when same script was saving and reading. For me it was with very large objects.

I solved it by making sure that the file was fully saved and close before reading.

So I changed my save code from:

saveRDS(my_large_object, "example.RData")

to this:

rdata_file = file("example.RData", blocking = TRUE)
saveRDS(my_large_object, file=rdata_file)
close(rdata_file)
Morten Grum
  • 962
  • 1
  • 10
  • 25