Methods to convert R data to YAML and back