https://github.com/r-lib/yaml
R package for converting objects to and from YAML
https://github.com/r-lib/yaml
cran r yaml
Last synced: 13 days ago
JSON representation
R package for converting objects to and from YAML
- Host: GitHub
- URL: https://github.com/r-lib/yaml
- Owner: r-lib
- License: other
- Created: 2008-04-28T21:52:03.000Z (over 17 years ago)
- Default Branch: main
- Last Pushed: 2025-12-08T16:54:12.000Z (about 1 month ago)
- Last Synced: 2025-12-09T10:51:53.913Z (about 1 month ago)
- Topics: cran, r, yaml
- Language: C
- Homepage: http://yaml.r-lib.org/
- Size: 2 MB
- Stars: 167
- Watchers: 4
- Forks: 39
- Open Issues: 16
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: COPYING
Awesome Lists containing this project
- Road2R - yaml - Methods to Convert R Data to YAML and Back. (Table of Contents / Data manipulation)
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# yaml
[](https://github.com/r-lib/yaml/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/r-lib/yaml)
yaml provides R bindings to [libyaml](https://pyyaml.org/wiki/LibYAML), a fast [YAML](https://yaml.org/) parser and emitter.
## Installation
Install from CRAN:
```{r}
#| eval: false
install.packages("yaml")
```
Or install the development version from GitHub:
```{r}
#| eval: false
# install.packages("pak")
pak::pak("r-lib/r-yaml")
```
## Usage
```{r}
library(yaml)
```
Parse YAML with `yaml.load()` or `read_yaml()`:
```{r}
yaml.load(
"
- 1
- 2
- 3
"
)
yaml.load(
"
a: 1
b: 2
"
)
```
Convert R objects to YAML with `as.yaml()` or `write_yaml()`:
```{r}
cat(as.yaml(list(a = 1:3, b = 4:6)))
```
See `vignette("yaml")` for more details on handlers, formatting options, and advanced usage.