[R] saveRDS() and readRDS() Why?

Patrick Connolly p_connolly @ending from @ling@hot@co@nz
Wed Nov 7 09:28:13 CET 2018


They're both about 3kb.

On 7/11/18 9:13 PM, Eric Berger wrote:
> What do you see at the OS level?
> i.e. on windows
> DIR rawData.rds
> on linux
> ls -l rawData.rds
> compare the file sizes on both.
>
>
> On Wed, Nov 7, 2018 at 9:56 AM Patrick Connolly 
> <p_connolly using slingshot.co.nz <mailto:p_connolly using slingshot.co.nz>> wrote:
>
>     From a Windows R session, I do
>
>     > object.size(rawData)
>     31736 bytes  # from scraping a non-reproducible web address.
>     > saveRDS(rawData, file = "rawData.rds")
>
>     Then copy to a Linux session
>
>     > rawData <- readRDS(file = "rawData.rds")
>     > rawData
>     [1] "rawData"
>     > object.size(rawData)
>     112 bytes
>     > rawData
>     [1] "rawData" # only the name and something to make up 112 bytes
>     >
>
>     Have I misunderstood the syntax?
>
>     It's an old version on Windows.  I haven't used Windows R since then.
>
>     major          3
>     minor          2.4
>     year           2016
>     month          03
>     day            16
>
>
>     I've tried R-3.5.0 and R-3.5.1 Linux versions.
>
>     In case it's material ...
>
>     I couldn't get the scraping to work on either of the R installations
>     but Windows users told me it worked for them.  So I thought I'd get
>     the R object and use it.  I could understand accessing the web address
>     could have different permissions for different OSes, but should that
>     affect the R objects?
>
>     TIA
>
>     -- 
>     ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>
>        ___    Patrick Connolly
>      {~._.~}                   Great minds discuss ideas
>      _( Y )_                 Average minds discuss events
>     (:_~*~_:)                  Small minds discuss people
>      (_)-(_)                              ..... Eleanor Roosevelt
>
>     ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>
>     ______________________________________________
>     R-help using r-project.org <mailto:R-help using 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]]



More information about the R-help mailing list