Home

rdata

RData is a binary file format used by the R programming language to store one or more R objects in a compact, serialized form. Files with extensions such as .RData, .rda, or sometimes .rdata can contain multiple objects saved from an R session and are designed to preserve the objects’ structure, attributes, and classes.

The primary tools for creating and using RData files are save() and load(). save(object1, object2, file =

RData differs from readRDS/readRDS in that an RData file can store multiple objects and load them into

Because RData is a binary format, it is not intended for human readability or easy interoperability with

Compatibility and security notes: RData files are generally stable across minor R version updates, but compatibility

"mydata.RData")
writes
the
specified
objects
to
the
file,
optionally
with
compression
(for
example,
compress
=
TRUE
or
a
method
like
"gzip").
load("mydata.RData")
restores
the
objects
into
the
current
environment
with
their
original
names.
The
function
save.image()
saves
the
entire
workspace
to
a
file,
effectively
snapshotting
all
objects
in
memory.
the
workspace
with
their
original
names,
whereas
readRDS/writeRDS
handle
a
single
object
and
require
explicit
assignment
(e.g.,
myobj
<-
readRDS("file.rds")).
non-R
tools.
For
cross-language
data
exchange
or
single-object
storage,
other
formats
such
as
CSV,
feather,
or
Parquet,
or
the
RDS
format,
may
be
preferred.
is
not
guaranteed
across
major
versions
or
platforms.
Load
RData
files
only
from
trusted
sources
to
avoid
unexpected
objects
or
memory
issues.