[R] error message: ReadItem: unknown type 64, perhaps written by later version of R
Franckx Laurent
laurent.franckx at vito.be
Fri Mar 6 10:41:06 CET 2015
> -----Original Message-----
> From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
> Sent: vrijdag 6 maart 2015 10:23
> To: Franckx Laurent; r-help at r-project.org
> Subject: Re: [R] error message: ReadItem: unknown type 64, perhaps written
> by later version of R
>
> On 05/03/2015 20:34, Franckx Laurent wrote:
> > Dear all
> >
> > I get the following error message when I try to load one specific RData
> object in R:
> >
> > Error: ReadItem: unknown type 64, perhaps written by later
> > version of R
> >
> >
> > The error message is odd because (a) this RData object was created just
> one hour berfore in a previous script (in a series of R scripts called in batch
> mode), so it would seem to me that it has been created by the same version
> of R that is now calling it (b) this script is "looping" over several scenarios and
> years, and the error only occurs for one very specific combination of
> scenarios and years. This object is about 6 Gb large, which is the same size as
> the other objects that were called in previous instances.
>
> What is 'odd' is that you missed the 'perhaps'.
>
> The most likely explanation is an I/O error when the file was written:
> it is 'perhaps' corrupted.
>
>
Dear Professor Riply,
Thank you for your suggestion.
The possibility of an I/O error in the writing of the file is actually something I had anticipated. The saving of the file is immediately followed by a test - see the code below.
save(list = skimlistname, file = file.path(pathsony[[rdata]],skimlistnamerdata))
if(file.exists(file.path(pathsony[[rdata]],skimlistnamerdata))) {
cat(skimlistnamerdata, " has been created. \n ", file = warningfile, sep = "", append = TRUE)
} else {
stop(skimlistnamerdata, " has not been created correctly. \n ")
}
My understanding was that this test code would stop the execution of the program if the file had not been saved correctly.
Moreover, each of my script starts with a verification whether any error message is contained in the Rout of the preceding scripts, and stops execution immediately if this is indeed the case.
Therefore, I should not even have reached the point where R tries to load the file in memory.
Is there any alternative to verifying whether a file has been created correctly without actually loading it?
Sincerely,
Laurent Franckx
> > I load the RData with the following command (where pathsony[[rdata]] is
> the folder with the RData and skimlistrdata is the file I try to load):
> >
> > load( file.path(pathsony[[rdata]],skimlistrdata))
> >
> >
> > The problem occurs both when I run the script in batch mode or when I run
> it interactively.
> >
> > I use a "x86_64-pc-linux-gnu" and "R version 3.1.2 (2014-10-31)".
> >
> >
> > Laurent Franckx, PhD
> > Senior researcher sustainable mobility VITO NV | Boeretang 200 | 2400
> > Mol Tel. ++ 32 14 33 58 22| mob. +32 479 25 59 07 | Skype:
> > laurent.franckx | laurent.franckx at vito.be | Twitter @LaurentFranckx
>
>
> --
> Brian D. Ripley, ripley at stats.ox.ac.uk
> Emeritus Professor of Applied Statistics, University of Oxford
> 1 South Parks Road, Oxford OX1 3TG, UK
VITO Disclaimer: http://www.vito.be/e-maildisclaimer
More information about the R-help
mailing list