Home

readRDSfile

ReadRDSfile is not a standard function in base R. In the R programming language, the canonical way to read a single object from a file created with saveRDS is readRDS. Some packages or project code may introduce a function named readRDSfile, typically as a wrapper or alias to readRDS, or as a convenience function to emphasize file-based reading.

When present, readRDSfile generally returns a single R object and accepts the same core arguments as readRDS,

Important distinctions include the format and scope. readRDSfile, like readRDS, reads data saved with saveRDS and

Examples of usage (assuming readRDSfile is defined similarly to readRDS): obj <- readRDSfile("model.rds"). See also readRDS, saveRDS,

most
commonly
the
file
parameter
and
an
optional
refhook
parameter
used
to
control
how
references
within
the
object
are
reconstructed.
The
exact
behavior
can
vary
if
a
package
defines
it
differently,
so
consulting
the
package
documentation
is
advisable.
returns
only
one
object.
It
does
not
load
multiple
objects
or
restore
an
entire
workspace
as
load
does
with
.RData
files.
The
RDS
format
is
specific
to
R,
meaning
objects
serialized
with
saveRDS
are
generally
intended
for
use
within
R
and
may
not
be
portable
to
other
languages
without
special
tooling.
As
with
all
deserialization,
reading
from
untrusted
sources
should
be
avoided
to
prevent
security
risks,
such
as
executing
code
embedded
in
the
serialized
object.
load,
and
the
RDS
file
format.