Hi, Indeed the S4 object is a class provided by a contributed package. However, the windows machine that reads the .rds fine does not even have the package installed.
I also confirm that I used readRDS (loadRDS was a typo on my part, sorry). In this case, I cannot provide a reprex as the contributed package function that creates the S4 object connects to a local database with secured access. I could send the code, but only the authorized people could run it. This is not the ideal situation for problem solving... I was wondering if there was a pathway through serialize / unserialize. I tried but I could not find the way to properly write and read the serialized object. Thanks ----- Original Message ----- From: "Duncan Murdoch" <murdoch.dun...@gmail.com> To: "Sebastien Bihorel" <sebastien.biho...@cognigencorp.com>, r-help@r-project.org Sent: Wednesday, July 17, 2019 10:42:13 AM Subject: Re: [R] Problem with save/load across R versions and OS On 17/07/2019 4:39 a.m., Sebastien Bihorel wrote: > Hi, > > I am trying to transfer an S4 object from a machine working with CentOS 7.2 / > R 3.4.3 to another one running Linux Mint 19 / R 3.6.0. If I save the object > using saveRDS in obj.rds, loadRDS returns an "unknown input format" error on > my Linux Mint machine. Interestingly enough, obj.rds loads just fine in a 3rd > machine running Windows Server 2012 / R 3.4.3. I tried also using save and > load and various values of the ascii and compression arguments, but still no > cigar... > > Do you have recommendations on how to successfully transfer my object to my > Linux Mint machine? > Normally such a transfer should just work. Reasons why it might not: - The error is being triggered by a contributed package somehow. Do contributed package versions match? - There's no loadRDS function in base R, the base R function is readRDS. If that's not just a typo above, then the loadRDS function you're using doesn't work. Use the base package functions instead. - There's a bug in R. In any case, we can't do much to help you without a reproducible example. Duncan Murdoch ______________________________________________ R-help@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.