我试图从书籍#34; Practical Data Science Cookbook" 代码如下:
year <- 2013
#Acquire offense data
url <- paste("http://sports.yahoo.com/nfl/stats/byteam? group=Offense&cat=Total&conference=NFL&year=season_",
year,"&sort=530&old_category=Total&old_group=Offense")
offense <- readHTMLTable(url, encoding = "UTF-8", colClasses="character")[[7]]
并收到错误:
Error in UseMethod("xmlNamespaceDefinitions") :
no applicable method for 'xmlNamespaceDefinitions' applied to an object of class "NULL"
请帮忙
答案 0 :(得分:0)
解决问题需要配置http代理。 在Windows桌面上编辑R-Studio快捷方式,在R-Studio名称后添加 代理定义
http_proxy=http://user_id:passwod@your_proxy:your_port/