---
title: "RData"
language: "en"
type: "Format"
summary: "R data format family."
keywords: 
- R Data Format
- rdata
- rda
- rds
- RData_family
- dataset
- statistical data
- statistical computation
- statistics
- data mining
- R
canonical_url: "https://reference.wolfram.com/language/ref/format/RData.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Importing & Exporting"
    link: "https://reference.wolfram.com/language/guide/ImportingAndExporting.en.md"
  - 
    title: "Listing of All Formats"
    link: "https://reference.wolfram.com/language/guide/ListingOfAllFormats.en.md"
  - 
    title: "Numerical Data Formats"
    link: "https://reference.wolfram.com/language/guide/NumericalDataFormats.en.md"
---
# RData (.rdata, .rda) 	[image]

``Import`` supports the RData format.

## Background & Context

* R data format family.
* Stores a collection of typed objects.
* 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.RData"]`` imports an RData file as a list of data.

Imported RData is represented in the Wolfram Language by real or integer numbers, strings, Boolean values ``True`` and ``False``, and ``DateObject`` specifications.

``Import["file.RData", elements]`` imports the specified elements.

``Import["file.RData", {elem, suba, subb, …}]`` imports a subelement.

The import format can be specified with ``Import["file", "RData"]`` or ``Import["file", {"RData", 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 file         |
| CloudImport     | import from a cloud object |
| ImportString    | import from a string       |
| ImportByteArray | 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                         |
| "LabeledData"        | association of labels and data                  |
| "RawData"            | raw data given as lists or NumericArray objects |
| "Tabular"            | list of Tabular objects                         |
| "TabularAssociation" | association of labels and Tabular objects       |

``Import`` by default uses the ``"Data"`` element.

Data descriptor elements:

|               |                                     |
| ------------- | ----------------------------------- |
| "DataFormat"  | descriptions and types of columns   |
| "Labels"      | names of columns                    |
| "ObjectCount" | number of objects stored in file    |
| "ObjectNames" | names of the objects stored in file |

Metadata elements:

|              |                                                 |
| ------------ | ----------------------------------------------- |
| "Dimensions" | dimensions of the data                          |
| "Version"    | version of the RData specification for the file |

## Options

``Import`` option:

"IndeterminateValues"	[`Automatic`](https://reference.wolfram.com/language/ref/Automatic.en.md)	replacement values for infinity, NaN, etc.

Use ``"IndeterminateValues"`` to provide replacement rules for different values. The following settings are supported:

|                                        |                                                           |
| -------------------------------------- | --------------------------------------------------------- |
| val                                    | a fixed value val for any indeterminate value             |
| <\|"NaN" -> …, "Inf" -> …, "-Inf" -> …\|> | specific replacements depending on the type indeterminate |

---

## Examples (13)

### Basic Examples (2)

Import an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData"]

Out[1]= {{{"Acorn Woodpecker", "Common Raven", "Red Avadavat", "European Robin"}, {46, 135, 13, 22}}, {{"Talk", "Workshop", "Keynote", "Social", "Talk", "Talk", "Workshop", "Social", "Talk", "Social"}, {DateObject[{2023, 10, 1}, "Day"], DateObject[{2023, 1 ... ct[{2023, 10, 13}, "Day"], DateObject[{2023, 10, 20}, "Day"], DateObject[{2023, 10, 21}, "Day"], DateObject[{2023, 10, 24}, "Day"], DateObject[{2023, 10, 26}, "Day"], DateObject[{2023, 10, 29}, "Day"]}, {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}}}
```

---

Summary of an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "Summary"]

Out[1]= DynamicModule[«6»]
```

### Import Elements (11)

#### Data Representation (5)

##### "Data" (1)

---

Import an RData file as lists of object values:

```wl
In[1]:= Import["ExampleData/sample.RData", "Data"]

Out[1]= {{{"Acorn Woodpecker", "Common Raven", "Red Avadavat", "European Robin"}, {46, 135, 13, 22}}, {{"Talk", "Workshop", "Keynote", "Social", "Talk", "Talk", "Workshop", "Social", "Talk", "Social"}, {DateObject[{2023, 10, 1}, "Day"], DateObject[{2023, 1 ... ct[{2023, 10, 13}, "Day"], DateObject[{2023, 10, 20}, "Day"], DateObject[{2023, 10, 21}, "Day"], DateObject[{2023, 10, 24}, "Day"], DateObject[{2023, 10, 26}, "Day"], DateObject[{2023, 10, 29}, "Day"]}, {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}}}
```

This is also the default element:

```wl
In[2]:= Import["ExampleData/sample.RData"]

Out[2]= {{{"Acorn Woodpecker", "Common Raven", "Red Avadavat", "European Robin"}, {46, 135, 13, 22}}, {{"Talk", "Workshop", "Keynote", "Social", "Talk", "Talk", "Workshop", "Social", "Talk", "Social"}, {DateObject[{2023, 10, 1}, "Day"], DateObject[{2023, 1 ... ct[{2023, 10, 13}, "Day"], DateObject[{2023, 10, 20}, "Day"], DateObject[{2023, 10, 21}, "Day"], DateObject[{2023, 10, 24}, "Day"], DateObject[{2023, 10, 26}, "Day"], DateObject[{2023, 10, 29}, "Day"]}, {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}}}
```

##### "LabeledData" (1)

---

Import an RData file as rules of labels and data:

```wl
In[1]:= Import["ExampleData/sample.RData", "LabeledData"]

Out[1]= {"birds" -> {"names" -> {"Acorn Woodpecker", "Common Raven", "Red Avadavat", "European Robin"}, "wingspan" -> {46, 135, 13, 22}}, "events" -> {"type" -> {"Talk", "Workshop", "Keynote", "Social", "Talk", "Talk", "Workshop", "Social", "Talk", "Social ... , 13}, "Day"], DateObject[{2023, 10, 20}, "Day"], DateObject[{2023, 10, 21}, "Day"], DateObject[{2023, 10, 24}, "Day"], DateObject[{2023, 10, 26}, "Day"], DateObject[{2023, 10, 29}, "Day"]}, "length" -> {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}}}
```

##### "RawData" (1)

---

Import an RData file as data given as lists or ``NumericArray`` objects:

```wl
In[1]:= Import["ExampleData/sample.RData", "RawData"]

Out[1]= {{{"Acorn Woodpecker", "Common Raven", "Red Avadavat", "European Robin"}, RawArray["Integer32", {46, 135, 13, 22}]}, {{"Talk", "Workshop", "Keynote", "Social", "Talk", "Talk", "Workshop", "Social", "Talk", "Social"}, RawArray["Integer32", {19631, 19632, 19636, 19638, 19643, 19650, 19651, 19654, 19656, 19659}], RawArray["Integer32", {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}]}}
```

##### "Tabular" (1)

---

Import an RData file as lists of labels and ``Dataset`` objects:

```wl
In[1]:= Import["ExampleData/sample.rdata", "Tabular"]

Out[1]=
{Tabular[Association["RawSchema" -> Association["ColumnProperties" -> 
     Association["names" -> Association["ElementType" -> "String"], 
      "wingspan" -> Association["ElementType" -> "Integer32"]], "KeyColumns" -> None, 
    "Backend" -> "Wol ... mentType" -> 
           "Date"["Integer32", "Day", Automatic, None]]], TabularColumn[
         Association["Data" -> {RawArray["Integer32", {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}], 
            {}, None}, "ElementType" -> "Integer32"]]}}]]]]}
```

##### "TabularAssociation" (1)

---

Import an RData file as an association of labels and ``Tabular`` objects:

```wl
In[1]:= Import["ExampleData/sample.rdata", "TabularAssociation"]

Out[1]=
<|"birds" -> Tabular[Association["RawSchema" -> Association["ColumnProperties" -> 
     Association["names" -> Association["ElementType" -> "String"], 
      "wingspan" -> Association["ElementType" -> "Integer32"]], "KeyColumns" -> None, 
    "Back ... entType" -> 
           "Date"["Integer32", "Day", Automatic, None]]], TabularColumn[
         Association["Data" -> {RawArray["Integer32", {30, 60, 180, 90, 30, 30, 60, 60, 30, 180}], 
            {}, None}, "ElementType" -> "Integer32"]]}}]]]]|>
```

#### Data Descriptors (4)

##### "DataFormat" (1)

---

Import the data type of each object in an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "DataFormat"]

Out[1]= {"birds" -> {"names" -> "String", "wingspan" -> "Integer32"}, "events" -> {"type" -> "String", "date" -> "Date", "length" -> "Integer32"}}
```

##### "Labels" (1)

---

Import the names of each column in an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "Labels"]

Out[1]= {"birds" -> {"names", "wingspan"}, "events" -> {"type", "date", "length"}}
```

##### "ObjectCount" (1)

---

Import the number of objects in an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "ObjectCount"]

Out[1]= 2
```

##### "ObjectNames" (1)

---

Import the names of objects in an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "ObjectNames"]

Out[1]= {"birds", "events"}
```

#### Metadata (2)

##### "Dimensions" (1)

---

Import the dimensions of each column in an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "Dimensions"]

Out[1]= {"birds" -> {"names" -> {4}, "wingspan" -> {4}}, "events" -> {"type" -> {10}, "date" -> {10}, "length" -> {10}}}
```

##### "Version" (1)

---

Import the version of an RData file:

```wl
In[1]:= Import["ExampleData/sample.RData", "Version"]

Out[1]= 3
```

## See Also

* [`Import`](https://reference.wolfram.com/language/ref/Import.en.md)
* [`CloudImport`](https://reference.wolfram.com/language/ref/CloudImport.en.md)
* [`RDS`](https://reference.wolfram.com/language/ref/format/RDS.en.md)
* [`MAT`](https://reference.wolfram.com/language/ref/format/MAT.en.md)
* [`HDF5`](https://reference.wolfram.com/language/ref/format/HDF5.en.md)
* [`SAS7BDAT`](https://reference.wolfram.com/language/ref/format/SAS7BDAT.en.md)
* [`XPORT`](https://reference.wolfram.com/language/ref/format/XPORT.en.md)
* [`DTA`](https://reference.wolfram.com/language/ref/format/DTA.en.md)
* [`POR`](https://reference.wolfram.com/language/ref/format/POR.en.md)
* [`SAV`](https://reference.wolfram.com/language/ref/format/SAV.en.md)

## Related Guides

* [Importing & Exporting](https://reference.wolfram.com/language/guide/ImportingAndExporting.en.md)
* [Listing of All Formats](https://reference.wolfram.com/language/guide/ListingOfAllFormats.en.md)
* [Numerical Data Formats](https://reference.wolfram.com/language/guide/NumericalDataFormats.en.md)

## History

* [Introduced in 2024 (14.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn140.en.md) \| [Updated in 2025 (14.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn142.en.md)