Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write YAML/JSON metadata in a separate function? #17

Closed
andrewheiss opened this issue Mar 30, 2018 · 1 comment
Closed

Write YAML/JSON metadata in a separate function? #17

andrewheiss opened this issue Mar 30, 2018 · 1 comment

Comments

@andrewheiss
Copy link

Currently it's possible to write CSVY metadata data to a separate file instead of at the top of the CSV file with write_csvy(..., metadata = "path/to/metadata.yaml"). This must be done in conjunction with writing a CSV file, though—write_csvy() doesn't work unless you specify an output file for the CSV. It might be helpful to have a function like write_metadata() that only writes the metadata without writing the CSV too.

For instance, I've run into an issue where I want to use readr::write_csv() to write a CSV because of its NA handling options, speed, tidyverseability, etc., but I also want to include CSVY YAML metadata as a separate file to distribute along with it. My current solution is to write two CSV files—one with write_csv() and one with write_csvy(..., metadata = "blah.yaml")—and then delete the CSV created with write_csvy(). But that's super roundabout and inefficient.

@leeper
Copy link
Owner

leeper commented Mar 30, 2018

Totally doable - we'll just move the metadata-writing code from write_csvy() into a separate function and export it.

jonocarroll added a commit to jonocarroll/csvy that referenced this issue May 17, 2018
still needs tests but tests are broken
@leeper leeper closed this as completed in 3e41ba8 Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants