ViewPipeSteps icon indicating copy to clipboard operation
ViewPipeSteps copied to clipboard

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

Open apsteinmetz opened this issue 6 years ago • 0 comments

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


apsteinmetz avatar Feb 28 '18 15:02 apsteinmetz