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

Multiple tables in HTML #126

Closed
sjackman opened this issue Sep 21, 2016 · 7 comments
Closed

Multiple tables in HTML #126

sjackman opened this issue Sep 21, 2016 · 7 comments
Assignees
Milestone

Comments

@sjackman
Copy link

Can the which parameter of import be used to extract the first/second/etc table from an HTML document with multiple tables?

@leeper leeper added this to the v0.5 milestone Sep 22, 2016
@leeper
Copy link
Contributor

leeper commented Sep 22, 2016

Not at present. But that should be pretty easy to implement with a change to this line: https://github.com/leeper/rio/blob/master/R/import_methods.R#L333

I'll put it on the TODO list.

@sjackman
Copy link
Author

Thanks!

@leeper
Copy link
Contributor

leeper commented Sep 25, 2016

I'm pushing an update with this feature momentarily. It will also be shipping to CRAN today.

@leeper leeper self-assigned this Sep 25, 2016
@leeper leeper closed this as completed in aa5c0fc Sep 25, 2016
@sjackman
Copy link
Author

sjackman commented Sep 25, 2016

Thanks for the quick implementation, Thomas! This gives a not-to-elegant but quite workable solution for reading multiple PSV tables from a Markdown document by rendering them to HTML and reading them with rio::import.

@sjackman
Copy link
Author

sjackman commented Sep 25, 2016

Does rio have a function to extract all tables from a given document (HTML, XLSX, et c) and return a list of data frames? It would be quite useful, particularly a named list, when the data format has names, like sheet names.

@leeper leeper reopened this Sep 25, 2016
@leeper
Copy link
Contributor

leeper commented Mar 6, 2017

I am pushing a commit with support for this via a new function, import_list(), that will handle both a multi-object file (HTML, xlsx) OR a vector of multiple file names.

@leeper leeper closed this as completed in 3036f57 Mar 6, 2017
@sjackman
Copy link
Author

sjackman commented Mar 6, 2017

Beautiful!

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