R serialized-data recovery

A damaged RData workspace or RDS object may fail because serialization, compression, or the file transfer is incomplete.

RData can store multiple named objects while RDS usually stores one serialized object. Both may use compression and versioned serialization, so recovery depends on the exact format and where damage occurred.

Understand the symptom

R save files and RDS objects use related serialization formats with different wrappers.

WHY

What is happening

R documents that save writes named objects with a header, while saveRDS serializes a single object. Files can use gzip, bzip2, xz, or newer zstd compression. Binary transfer changes, truncation, incompatible versions, or damaged compressed streams can block restore.

What you may see

Symptoms that change the recovery path.

01

Bad restore file magic number

The file may be wrong type, transferred as text, or have a damaged header.

02

Error reading from connection

Compression or serialized data may end early.

03

Workspace loads only some objects

Damage may occur after earlier serialized objects.

04

Object type is incompatible

R version, package classes, or external pointers may not restore normally.

Protect the source

Actions that can make the situation worse.

01

load writes objects into an environment

Inspect candidates in an isolated environment.

02

Resaving hides the original failure

Keep every source byte and checksum.

03

Recovered objects may depend on packages

Preserve versions, class definitions, and scripts.

Do this now

Safe steps before evaluation.

01

Copy every save candidate

Keep RData, RDS, temporary files, checkpoints, and backups.

02

Record expected objects

List names, classes, dimensions, row counts, and priority values.

03

Preserve the R environment

Save scripts, package lockfiles, sessionInfo, and platform details.

04

Protect the source device

Image unstable media before repeated decompression.

NEPFOSYS process

How a data-first evaluation proceeds.

01

Serialization assessment

NEPFOSYS identifies wrapper, version, compression, headers, and readable object boundaries.

02

Selective object extraction

Recoverable objects are restored in isolation and saved to new files.

03

Analytical validation

Names, classes, dimensions, attributes, row counts, and priority results are compared with scripts.

A clear next step

Preserve the original device before another repair or recovery attempt.

Start a case with the exact symptoms, incident timeline, prior attempts, encryption details, and the files that matter most. NEPFOSYS will route the case to the appropriate DFW intake or nationwide mail-in path.

Start with a case review

Questions, answered

What customers ask before starting.

Is RData the same as RDS?

No. RData commonly stores multiple named objects; RDS stores one object for assignment on read.

Can infoRDS prove a file is valid?

No. R documentation states that infoRDS does not establish that a file is a valid serialization.

Why keep package versions?

Restored objects may depend on package classes, serialization behavior, and code from the original environment.

DFW local · Nationwide mail-in

Protect the device. Start with the facts.

Start my recovery case