R/yaml.R

Defines functions qread.yaml qwrite.yaml

#' @method qread yaml
#' @export
qread.yaml <- function(file, type, ...) {
	.check_package("yaml");

	yaml::yaml.load_file(file, ...)
}

#' @method qwrite yaml
#' @export
qwrite.yaml <- function(x, file, type, append=FALSE, ...) {
	.check_package("yaml");

	cat(yaml::as.yaml(x, ...), sep="", file=file, append=append)
}

Try the io package in your browser

Any scripts or data that you put into this service are public.

io documentation built on Dec. 18, 2019, 1:39 a.m.