{
  "name": "R serialization format options relevant to .rds files",
  "description": "Compilation of the stream header codes, compression options and format versions that apply to RDS files, compiled from the R-devel base manual pages and the R Internals manual (section 1.8).",
  "page": "https://casrai.org/guides/rds-file",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-12T13:51:09Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Feature",
      "unit": "",
      "description": ""
    },
    {
      "name": "Option or value",
      "unit": "",
      "description": ""
    },
    {
      "name": "Meaning in the R documentation",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Feature": "Stream header",
      "Option or value": "X (then newline)",
      "Meaning in the R documentation": "Binary stream in XDR (big-endian) format; the normal default"
    },
    {
      "Feature": "Stream header",
      "Option or value": "A (then newline)",
      "Meaning in the R documentation": "ASCII stream; written by saveRDS with ascii = TRUE"
    },
    {
      "Feature": "Stream header",
      "Option or value": "B (then newline)",
      "Meaning in the R documentation": "Native binary stream"
    },
    {
      "Feature": "Compression (compress argument)",
      "Option or value": "TRUE or \"gzip\"",
      "Meaning in the R documentation": "gzip; the default for saveRDS"
    },
    {
      "Feature": "Compression (compress argument)",
      "Option or value": "\"bzip2\"",
      "Meaning in the R documentation": "bzip2 compression"
    },
    {
      "Feature": "Compression (compress argument)",
      "Option or value": "\"xz\"",
      "Meaning in the R documentation": "xz compression"
    },
    {
      "Feature": "Compression (compress argument)",
      "Option or value": "\"zstd\"",
      "Meaning in the R documentation": "zstd compression"
    },
    {
      "Feature": "Serialization version",
      "Option or value": "2",
      "Meaning in the R documentation": "Used from R 1.4.0 (Dec 2001) and the default until R 3.5.3 (Mar 2019); the only non-default value saveRDS accepts"
    },
    {
      "Feature": "Serialization version",
      "Option or value": "3",
      "Meaning in the R documentation": "Introduced in R 3.5.0; current default; adds ALTREP custom serialization and records native encoding"
    }
  ],
  "sources": [
    {
      "title": "R-devel base manual: readRDS, saveRDS, infoRDS",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/readRDS.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "R Internals, section 1.8 Serialization Formats",
      "url": "https://cran.r-project.org/doc/manuals/r-release/R-ints.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "R-devel base manual: serialize, unserialize",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/serialize.html",
      "accessed": "2026-11-12"
    }
  ]
}