RDS (.rds)
- Import supports the RDS format.
Background & Context
-
- R data format.
- Stores a single typed object.
- Supports ASCII, binary and XDR (big-endian binary) representations.
- Supports GZIP, BZIP2 and XZ compressions.
- Released in 1995 with an initial version of R.
Import
- Import ["file.rds"] imports an RDS file as a single table of data.
- Imported RDS is represented in the Wolfram Language by real or integer numbers, strings, Boolean values True and False , and DateObject specifications.
- Import ["file.rds",elements] imports the specified elements.
- Import ["file.rds",{elem,suba,subb,…}] imports a subelement.
- The import format can be specified with Import ["file","RDS"] or Import ["file",{"RDS",elem,…}].
- Import supports the following data types:
-
"Boolean" Booleans"Date" dates as a list of DateObject objects"Integer32" 32-bit integers"Real64" IEEE double‐precision numbers"String" string of characters"Timestamp" time instances
- See the following reference pages for full general information:
-
Import import from a fileCloudImport import from a cloud objectImportString import from a stringImportByteArray import from a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file"Summary" summary of the file"Rules" list of rules for all available elements
- Data representation elements:
-
"Data" two-dimensional array"Dataset" table data as a Dataset"EventSeries" table data as an EventSeries"LabeledData" association of labels and data"RawData" raw data given as lists or NumericArray objects"Tabular" table data as a Tabular object"TimeSeries" table data as a TimeSeries
- Import by default uses the "Data" element.
- Data descriptor elements:
-
"ColumnLabels" names of columns"ColumnTypes" association of column names and types
- Metadata elements:
-
"Dimensions" dimensions of the data"Version" version of the RDS specification for the file
Examples
open all close allBasic Examples (2)
Import an RDS file:
Import["ExampleData/sample.rds"]Summary of an RDS file:
Import["ExampleData/sample.rds", "Summary"]Import Elements (11)
Data Representation (7)
"Data" (1)
Import an RDS file as lists of values:
Import["ExampleData/sample.rds", "Data"]This is also the default element:
Import["ExampleData/sample.rds"]"Dataset" (1)
Import an RDS file as a Dataset object:
Import["ExampleData/sample.rds", "Dataset"]"EventSeries" (1)
Import an RDS file as an EventSeries object:
Import["ExampleData/sample.rds", "EventSeries"]"LabeledData" (1)
Import an RDS file as rules of labels and data:
Import["ExampleData/sample.rds", "LabeledData"]"RawData" (1)
Import an RDS file as data given as lists or NumericArray objects:
Import["ExampleData/sample.rds", "RawData"]"Tabular" (1)
Import an RDS file as a Tabular object:
Import["ExampleData/sample.rds", "Tabular"]"TimeSeries" (1)
Import an RDS file as a TimeSeries object:
Import["ExampleData/sample.rds", "TimeSeries"]Data Descriptors (2)
"ColumnLabels" (1)
Import the names of each column in an RDS file:
Import["ExampleData/sample.rds", "ColumnLabels"]"ColumnTypes" (1)
Import the types of each column in an RDS file:
Import["ExampleData/sample.rds", "ColumnTypes"]Metadata (2)
"Dimensions" (1)
Import the dimensions of each column in an RDS file:
Import["ExampleData/sample.rds", "Dimensions"]"Version" (1)
Import the version of an RDS file:
Import["ExampleData/sample.rds", "Version"]Import Options (1)
"TimeColumn" (1)
By default, the time column is selected automatically for "TimeSeries" and "EventSeries" elements:
Import["ExampleData/sample.rds", "TimeSeries"]Use the "TimeColumn" option to specify the time column:
Import["ExampleData/sample.rds", "TimeSeries", "TimeColumn" -> "timestamp"]History
Introduced in 2024 (14.0) | Updated in 2025 (14.2) ▪ 2026 (15.0)