Each time I finish with a session I save the image. Today the saved image did not load and manually running 'load('.RData') fails:> load('.RData')Error in load(".RData") : ReadItem: unknown type 0, perhaps written by later version of R>This has not happened before. Installed is R-4.1.2-x86_64-1_SBo and in the PWD I see: $ ll .RData* -rw-r--r-- 1 rshepard users 28074080 Dec 22 15:32 .RData -rw-r--r-- 1 rshepard users 134 Nov 4 14:57 .RDataTmp -rw-r--r-- 1 rshepard users 0 Nov 4 14:57 .RDataTmp1 What might be keeping .RData from loading? Is there a maximum size for .RData? The /home partition has 270G available space so that's not limiting. How do I load it? TIA, Rich
This practice (saving and resuming from Rdata files) often ends badly this way. Objects that are "shared" in memory get saved as separate data and may not "fit" when re-loaded. This is why re-running from scratch should always be part of your workflow. There are caching approaches that track individual objects rather than entire workspaces such as the targets package or others or you can roll your own with saveRDS/readRDS or the qs package. On December 23, 2021 11:18:45 AM PST, Rich Shepard <rshepard at appl-ecosys.com> wrote:>Each time I finish with a session I save the image. Today the saved image >did not load and manually running 'load('.RData') fails: >> load('.RData') >Error in load(".RData") : > ReadItem: unknown type 0, perhaps written by later version of R >> > >This has not happened before. > >Installed is R-4.1.2-x86_64-1_SBo and in the PWD I see: >$ ll .RData* >-rw-r--r-- 1 rshepard users 28074080 Dec 22 15:32 .RData >-rw-r--r-- 1 rshepard users 134 Nov 4 14:57 .RDataTmp >-rw-r--r-- 1 rshepard users 0 Nov 4 14:57 .RDataTmp1 > >What might be keeping .RData from loading? Is there a maximum size for >.RData? The /home partition has 270G available space so that's not limiting. > >How do I load it? > >TIA, > >Rich > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.
Three things you might try using R (and show the results in this email thread): * load(verbose=TRUE, ".RData") # see how far it gets before stopping * file.info(normalizePath(".RData")) # is this the file you think it is? * dput(readBin(".RData", what=raw(), n=100)) The last will print some hex numbers that others may be able to interpret. E.g., it may show that this .RData is not from a call to save() or save.image(). -Bill On Thu, Dec 23, 2021 at 11:19 AM Rich Shepard <rshepard at appl-ecosys.com> wrote:> Each time I finish with a session I save the image. Today the saved image > did not load and manually running 'load('.RData') fails: > > load('.RData') > Error in load(".RData") : > ReadItem: unknown type 0, perhaps written by later version of R > > > > This has not happened before. > > Installed is R-4.1.2-x86_64-1_SBo and in the PWD I see: > $ ll .RData* > -rw-r--r-- 1 rshepard users 28074080 Dec 22 15:32 .RData > -rw-r--r-- 1 rshepard users 134 Nov 4 14:57 .RDataTmp > -rw-r--r-- 1 rshepard users 0 Nov 4 14:57 .RDataTmp1 > > What might be keeping .RData from loading? Is there a maximum size for > .RData? The /home partition has 270G available space so that's not > limiting. > > How do I load it? > > TIA, > > Rich > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Dear Rich, If you want to look at Rdata-files in a quick way in the terminal, use this little gem in your .zshrc.local: readrdata() { Rscript -e "options(width=$COLUMNS); load('$1'); sapply(ls(), get, simplify=F)" | less } Merry Christmas! Best, Rasmus