Add cran-comments.md
yaml provides R bindings to libyaml, a fast YAML parser and emitter.
Install from CRAN:
install.packages("yaml")
Or install the development version from GitHub:
# install.packages("pak") pak::pak("r-lib/r-yaml")
library(yaml)
Parse YAML with yaml.load() or read_yaml():
yaml.load()
read_yaml()
yaml.load( " - 1 - 2 - 3 " ) #> [1] 1 2 3 yaml.load( " a: 1 b: 2 " ) #> $a #> [1] 1 #> #> $b #> [1] 2
Convert R objects to YAML with as.yaml() or write_yaml():
as.yaml()
write_yaml()
cat(as.yaml(list(a = 1:3, b = 4:6))) #> a: #> - 1 #> - 2 #> - 3 #> b: #> - 4 #> - 5 #> - 6
See vignette("yaml") for more details on handlers, formatting options, and advanced usage.
vignette("yaml")
R语言中用于读写YAML格式数据的包
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
yaml
yaml provides R bindings to libyaml, a fast YAML parser and emitter.
Installation
Install from CRAN:
Or install the development version from GitHub:
Usage
Parse YAML with
yaml.load()orread_yaml():Convert R objects to YAML with
as.yaml()orwrite_yaml():See
vignette("yaml")for more details on handlers, formatting options, and advanced usage.