我试图将http://killedbypolice.net/处的表格导入R.表格很大并且合并了单元格,所以它并不简单。我的代码的最后一步永远不会结束。如何将表格放入我的R会话?
这是我尝试的内容:
url <- "http://killedbypolice.net/"
# read in the web page
tmp1 <- read_html(url, options = "HUGE")
# Extract the table from the web page, I used Chrome's inspector to
# identify the XPath here, following these instructions
# http://blog.corynissen.com/2015/01/using-rvest-to-scrape-html-table.html
tmp2 <- html_nodes(tmp1, xpath='/html/body/center/font/font/font/font/font/font/table')
# Convert HTML table to a data frame
tmp3 <- html_table(tmp2, fill = TRUE)
问题是最后一行永远运行。我想它会挂在合并的细胞上?
还有另一种方法可以将HTML表格放入数据框吗?