-
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
Add read_markdown_table #104
Conversation
This doesn't seem quite right to me - you're manually dropping the second line (i.e. the dashes) but the column guesser will still see it so I think every column will be imported as text. Instead I think you'll need to read the column names yourself (since they're always required in this format), then call |
Read Markdown tables. For example: A|B|C|D -|-|-|- 0|1|2|3 4|5|6|7 To do: Determine automatically whether the column names are present. Remove leading and trailing white space around each cell.
8199a9d
to
96e6499
Compare
Hi, Hadley. The column names are in fact optional (see below), at least for Pandoc. The row of hyphens is not optional. See Extension: pipe_tables. GitHub Markdown preview doesn't like a missing header line. Good observation about the column formats. I hadn't noticed that. I've updated the PR. It duplicates a lot of code from
|
@hadley I'd love for this function to make it into your CRAN submission. I'm happy to do what's needed to get it in. How are you feeling about this PR? Would you prefer adding the option |
I think this looks ok, but I'd rather call it |
If you can do by Friday, I can include in the next version of readr |
Hi, Hadley. Yep, I think I can get this done by Friday. I'll need to add a |
Hmmm, I really want to avoid have skip before and after header parameters. |
I can duplicate the code of |
I could see a |
Hmmm, I think that calls for a more generalised solution which I don't have time to think about at the moment. Lets try again for the next version. |
While this idea I think is interesting in practice the number of documents which contain just markdown tables and nothing else is very small, so it is hard to envision cases when this would be used. Since it has been languishing for a number of years I think it should be closed. |
No worries at all, Jim. We discussed reading Markdown tables using |
Read Markdown tables. For example:
To do: