-
Notifications
You must be signed in to change notification settings - Fork 286
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/read simple list-columns? #303
Comments
Hmmmmmmmmmmmm, it wouldn't be too hard - I'd just have to |
On consideration, I now think this is probably a bad idea - to go from the output of |
If this ever gets reconsidered, here's a related discussion from Bioconductor. https://support.bioconductor.org/p/83911/ ... which also has |
There is a lot of precedent for representing at least a single level of nesting by embedding CSV inside of a CSV column. One example is Solr: https://wiki.apache.org/solr/CSVResponseWriter. |
I'll reopen just so we think about again in the future. |
I had the same problem today, my last column of the df is a list of characters (separated by commas). I want to write it to file and got this error: Error in stream_delim_(df, path, ...) :
Don't know how to handle vector of type list. Thanks. |
Per discussion here, one could represent a list-col as a character vector of JSON strings. |
I am very ignorant when it comes to JSON, so please excuse my naivety if this comment turns out to be silly. One challenge I have had when trying to work with JSON are unsupported classes (see jeroen/jsonlite#62 for the general issue and rstudio/DT#537 and jrowen/rhandsontable#242 for the particular case of class |
(I'm also having the same issue, watching this thread.) |
Would like to add here that the lack of quotes in actual strings when printed to console makes this almost impossible to detect as well. ['my', 'first', 'list'] looks like a list but is actually not. I was using unnest() on my csv trying to figure out why it wasn't working for almost an hour. |
While I can see the appeal, I think ultimately this would be better done as a post-processing step than something built into readr. |
I realize this is probably a non-starter.
But if a
dplyr
workflow leaves you with a simple list-column and you want to write the data frame out to text file, you're stuck withdput()
. By simple, I mean the elements are atomic vector. But a human-readable and GitHub/Excel-viewable tsv or csv is so much nicer.The way this data frame is displayed by
View()
in RStudio is sort of tantalizing. Couldreadr
ever support this sort of write/read?The text was updated successfully, but these errors were encountered: