R/dct_object_to_yaml.R

Defines functions dct_object_to_yaml

Documented in dct_object_to_yaml

#' Convert a DCT object to YAML
#'
#' @param dctObject The DCT object
#'
#' @return A character vector.
#'
#' @export
dct_object_to_yaml <- function(dctObject) {

  if (!inherits(dctObject, "psyverse_dct")) {
    stop("Object dctObject must have class `psyverse_dct`, but has class ",
         vecTxtQ(class(dctObject)),
         ".");
  }

  yaml <-
    yaml::as.yaml(list(dct = dctObject));

  return(yaml);

}

Try the psyverse package in your browser

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

psyverse documentation built on March 7, 2023, 8:31 p.m.