嘗試在R包XML中使用readHTMLTable
函數時遇到問題。當運行R readHTMLTable()函數錯誤
library(XML)
baseurl <- "http://www.pro-football-reference.com/teams/"
team <- "nwe"
year <- 2011
theurl <- paste(baseurl,team,"/",year,".htm",sep="")
readurl <- getURL(theurl)
readtable <- readHTMLTable(readurl)
我得到的錯誤信息:
Error in names(ans) = header :
'names' attribute [27] must be the same length as the vector [21]
我過R工作室0.96.330運行64位R 2.15.1。似乎還有其他幾個關於readHTMLTable()函數的問題,但沒有提到這個具體問題。有誰知道發生了什麼事?