> For the complete documentation index, see [llms.txt](https://ondrej-kvasnovsky-2.gitbook.io/handbook-of-hidden-data-scientist/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ondrej-kvasnovsky-2.gitbook.io/handbook-of-hidden-data-scientist/r/textual_formats.md).

# Textual Serialization

We can serialize an object into a file with all the metadata.

## Write object into file

```r
data <- data.frame(a=1, b=2)
dput(data, file="data.R")
```

## Read object from file

```r
newData <- dget("data.R")
```

## Reading and writting multiple objects

[dump](http://stat.ethz.ch/R-manual/R-devel/library/base/html/dump.html) and [source](http://stat.ethz.ch/R-manual/R-devel/library/base/html/source.html) functions are used to read and write multiple objects.

Or we can use [save](http://stat.ethz.ch/R-manual/R-devel/library/base/html/save.html) and [load](http://stat.ethz.ch/R-manual/R-devel/library/base/html/load.html) functions.
