Expand description
GNU R serialization — reading and writing RDS files.
Implements both the XDR binary format (format ‘X’) and the ASCII text format
(format ‘A’) used by readRDS()/saveRDS().
See R-ints.texi “Serialization Formats” for the spec.
Structs§
- Ascii
Reader 🔒 - Line-oriented reader for the ASCII serialization format (format ‘A’).
- Ascii
Writer 🔒 - Line-oriented writer for the ASCII serialization format (format ‘A’).
- XdrReader 🔒
- Cursor-based reader for big-endian (XDR) binary data.
- XdrWriter 🔒
- Cursor-based writer for big-endian (XDR) binary data.
Constants§
- BASEENV_
SXP 🔒 - BASENAMESPACE_
SXP 🔒 - BUILTINSXP 🔒
- CHARSXP 🔒
- CLOSXP 🔒
- CPLXSXP 🔒
- EMPTYENV_
SXP 🔒 - ENVSXP 🔒
- EXPRSXP 🔒
- GLOBALENV_
SXP 🔒 - HAS_
ATTR_ 🔒MASK - HAS_
TAG_ 🔒MASK - INTSXP 🔒
- LANGSXP 🔒
- LGLSXP 🔒
- LISTSXP 🔒
- MISSINGARG_
SXP 🔒 - NAMESPACESXP 🔒
- NILSXP 🔒
- NILVALUE_
SXP 🔒 - PROMSXP 🔒
- RAWSXP 🔒
- REALSXP 🔒
- REFSXP 🔒
- R_
NA_ 🔒INTEGER - R’s NA_INTEGER is i32::MIN
- R_
NA_ 🔒LOGICAL - R’s NA_LOGICAL is also i32::MIN in serialization
- R_
NA_ 🔒REAL_ BITS - R’s NA_REAL bit pattern: 0x7FF00000000007A2 (a specific NaN)
- SPECIALSXP 🔒
- STRSXP 🔒
- SYMSXP 🔒
- UNBOUNDVALUE_
SXP 🔒 - VECSXP 🔒
Functions§
- format_
hex_ 🔒float - Format a f64 as a C-style hex float string (matching R’s %a format).
- is_
binary_ rds - Check if bytes look like a GNU R binary RDS file.
- is_
bzip2_ data - Check for bzip2 magic number (“BZh”).
- is_
gzip_ data - Check for gzip magic number (0x1f 0x8b).
- parse_
ascii_ 🔒double - Parse a double from R’s ASCII serialization format.
- parse_
hex_ 🔒float - Parse a C-style hex float string like “0x1.999999999999ap-4” into f64.
- serialize_
ascii - Serialize an R value to ASCII text format (version 2).
- serialize_
rdata - Serialize named bindings to GNU R binary .RData format (RDX2).
- serialize_
rds - Serialize an R value to an RDS byte stream, optionally gzip-compressed.
- serialize_
xdr - Serialize an R value to XDR binary format (version 2).
- unserialize_
rds - Decompress gzip data and then deserialize.
- unserialize_
xdr - Deserialize an R object from either XDR binary or ASCII format bytes.