BIOL548O / Discussion

A repository for course discussion in BIOL548O
0 stars 0 forks source link

short series of videos on CSVY (by me) #37

Open aammd opened 7 years ago

aammd commented 7 years ago

hello @BIOL548O/2017_students ,

I have made a few short videos talking about how to create CSVY data. They're not mandatory, but you might find them useful if you have chosen that metadata format.

https://www.youtube.com/playlist?list=PLlsfgzA47vkgvwpNSZp7k93kKVhJygN_u

jas-wong commented 7 years ago

Hey @aammd

In case it wasn't on purpose, just thought I'd let you know that the video about "reading csvy with comments" was uploaded twice to the playlist. And no video about writing csvy.

aammd commented 7 years ago

@jas-wong oh no! that was definitely my mistake!

aammd commented 7 years ago

Wait no this is the video about CSVY I called it "writing yaml" by mistake (the Y in CSVY stands for YAML, because that is the format the metadata is written in)

jas-wong commented 7 years ago

@aammd Got it, thanks!

LinneaSandell commented 7 years ago

This was very helpful @aammd. I have an issue! When I try to read in my csvy file to edit it manually, R gives error "The file is too large to open in the source editor". I imagine that I can edit the file in a different text editor. However, I was wondering if there is a way I can write a YAML in R and later attach it to the csv to produce my csvy?

aammd commented 7 years ago

@LinneaSandell this is an interesting problem. In your case, I would probably write the metadata in its own text file (FILENAME_metadata.yaml or something) and then either a) leave it that way (two files) or b) stick one on top of another, with R or a shell script

aammd commented 7 years ago

@LinneaSandell something like this (readr makes this easy):

library(readr)

one <- read_lines("YAMLFILE.yaml")
two <- read_lines("DATAFILE.csv")

write_lines(c(one, two), "COMBINEDFILE.csvy")
rstorlund commented 7 years ago

@aammd I can't read in my data package using datapkg_read... I get the error message: "Error in readtokens(data, tokenizer, col_specs, colnames, locale, : expecting a string" and I can't seem to find any solutions. Any idea what I'm doing wrong?