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

If step can't be 'View'ed, it is skipped #4

Open
apsteinmetz opened this issue Feb 28, 2018 · 0 comments
Open

If step can't be 'View'ed, it is skipped #4

apsteinmetz opened this issue Feb 28, 2018 · 0 comments

Comments

@apsteinmetz
Copy link

In this case, using rvest::html_node() I get
Error in View : cannot coerce class xml_node to a data.frame

This is a weakness of View and is an 'polite' failure as it does not prevent data.frame tabs from being created for the following nodes.

Perhaps there is a way to use print() to create something that View can handle, although html_node() %>% print() %>% View() doesn't work.

suppressPackageStartupMessages({
  library(dplyr)
  library(stringr)
  library(rvest) 
})

URL<-"https://en.wikipedia.org/wiki/Winter_Olympic_Games"
wiki_page_raw<-read_html(URL)
wiki_page_raw %>% 
  html_node(xpath="//*[@id='mw-content-text']/div/table[3]") %>% 
  View()
#> Error in as.data.frame.default(x): cannot coerce class ""xml_node"" to a data.frame


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant