-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathREADME.Rmd
More file actions
73 lines (55 loc) · 1.25 KB
/
README.Rmd
File metadata and controls
73 lines (55 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# yaml
<!-- badges: start -->
[](https://github.com/r-lib/yaml/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/r-lib/yaml)
<!-- badges: end -->
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.