Scraping a complex HTML table into a data.frame in R
问题 I am trying to load wikipedia's data on US Supreme Court Justices into R: library(rvest) html = html("http://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States") judges = html_table(html_nodes(html, "table")[[2]]) head(judges[,2]) [1] "Wilson, JamesJames Wilson" "Jay, JohnJohn Jay†" [3] "Cushing, WilliamWilliam Cushing" "Blair, JohnJohn Blair, Jr." [5] "Rutledge, JohnJohn Rutledge" "Iredell, JamesJames Iredell" The problem is that the data is malformed. Rather