THE FILE FIELD GUIDE
.rds

R Serialized Data

Data & Science

RDS commonly stores one R object, which may be a list, model or data frame. Assign the return value of readRDS to your chosen variable, unlike load restoring named objects from RDATA.

What it is used for
Saving and restoring one R object
What the file contains
Binary data
All sections, questions and sources

Content reviewed: · Editor:Kai

Opening steps

Choose your environment or purpose to see its steps.

Read RDS under a chosen name

Typically restores one R object.

  1. Verify trusted provenance and R/package versions.
  2. Assign readRDS output to a separate variable.
  3. Inspect class/structure and required values.
Inspect conditions behind a load error

Check serialization version and compression.

  1. Identify producer R version and compression.
  2. Compare reader compatibility and completed transfer.
  3. Read a copy in a compatible environment and validate content.
Export for another environment

Distinguish models from ordinary tables.

  1. Identify the object class and destination use.
  2. Export tables appropriately or save a separate R-compatible copy.
  3. Compare shape, types, missing values and attributes.

Menu labels and support vary by app, OS and version. Preserve the original before making changes.

Troubleshooting by symptom

  • load fails: distinguish RDS/RDATA and use the matching reader.
  • Old R fails: check serialization/compression and required R version.
  • Not a table: identify list/model class and required components.
  • load rejects RDS: distinguish readRDS from load.
  • Model operations fail: inspect required package/version.
  • Old R rejects compression: inspect writer settings and compatibility.

Tabular/array content in RDS → CSV or other exchange data

  1. Identify the object and define which data/attributes to export.
  2. Compare encoding, factors, dates, missing values and precision.
  3. Record object class/environment and validate required values after reopening.

CSV cannot reproduce arbitrary R classes/models; R documentation cautions against treating RDS as a general interchange format.

One object need not be one table

Inspect the class/structure before treating an object as tabular data.

Source for these steps:R Core Team · Serialization Interface for Single Objects / R Core Team · Reload Saved Datasets

Record R, compression and package requirements

A deserialized model may still require packages; preserve environment information.

Check documented compression-version requirements before making an interchange copy.

Source for these steps:R Core Team · Serialization Interface for Single Objects / R Core Team · Reload Saved Datasets

Related-format differences

Related-format differences
FormatMain roleWhat to check
RDSSingle-object serializationreadRDS return value
RDataNamed-object storageload environment
CSV / ParquetTabular interchangeNot a general model export

Handling and security

Use trusted objects, avoid executing unknown functions/classes and review sensitive fields.

Questions and answers

Always a data frame?

No; it may be a list/model.

Does it restore the original name?

You assign the returned object.

Can I rename it to RDATA?

Use appropriate read/write methods instead.

Can exporting a model to CSV preserve reuse?

Models can depend on structure, attributes and packages; preserve the object/environment.

Does infoRDS prove a file is intact?

Metadata inspection is not a complete integrity/content test.

Format facts: name, steward and MIME type
Formal name
R single-object serialization
Steward / specification
R Core Team
MIME type
Depends on the producer or server; an extension alone does not establish a MIME type.

Primary and official sources