最初,除了forecasttext <- 0
之外,我在下面写了所有代码但是我一直收到错误:找不到对象。所以我将forecastext定义为0.
现在我遇到了错误:-html_text(forecasthtml)出错:一元运算符的参数无效
任何解决方案?
install.packages("rvest")
library (rvest)
forecasttext <- 0
weatherlink <- read_html("http://forecast.weather.gov/MapClick.php?
lat=36.11479000000003&lon=-115.17280999999997#.WXfQRdPytE4")
forecasthtml <- html_node(weatherlink, "#detailed-forecast div:nth-
child(1) :nth-child(1)")
forecasttext < - html_text (forecasthtml)
答案 0 :(得分:3)
forecasttext < - html_text (forecasthtml)
应该是
forecasttext <- html_text (forecasthtml)