[R] Problem with save/load across R versions and OS

Sebastien Bihorel @eb@@t|en@b|hore| @end|ng |rom cogn|gencorp@com
Wed Jul 17 22:31:45 CEST 2019


Hi,

I managed to transfer my object trough dput/dget and a text file export. I will look into stripping the function for the reprex creation when I have more time (this is a ginormous function)...

Thanks to your input and Bert's


----- Original Message -----
From: "Duncan Murdoch" <murdoch.duncan using gmail.com>
To: "Sebastien Bihorel" <sebastien.bihorel using cognigencorp.com>
Cc: r-help using r-project.org
Sent: Wednesday, July 17, 2019 3:04:46 PM
Subject: Re: [R] Problem with save/load across R versions and OS

On 17/07/2019 2:02 p.m., Sebastien Bihorel wrote:
> 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.

I don't know about that approach.

You can probably produce a reprex, it'll just be work:  copy the 
function from the contributed package, and edit it so that the line that 
reads from the database just generates some fake data in a similar 
format.  If you can make it reproducible, then cut out as much stuff as 
possible, keeping it reproducible, and post the final minimal reprex.

It's likely to take some time, but also likely to lead to a solution 
(either by you, when you notice a bug in the contributed package and can 
fix it, or by one of us, when you post the reprex and we dig in).

Duncan Murdoch



More information about the R-help mailing list