簡體   English   中英

錯誤:找不到函數“read_html”

[英]Error: could not find function “read_html”

我用這個代碼

library(rvest)
url<-read_html("http://en.wikipedia.org/wiki/Brazil_national_football_team")

我收回了這個錯誤

Error: could not find function "read_html"

知道這有什么問題嗎?

還有像這樣的多個鏈接

library(rvest)
urls<-html("https://en.wikipedia.org/wiki/Financial_crisis",
"https://en.wikipedia.org/wiki/Inflection",
"https://en.wikipedia.org/wiki/Financial_crisis_of_2007%E2%80%9308"
)

我收到了這個:

 Error: is.config(config) is not TRUE

我怎樣才能讓它發揮作用? 如果我將此鏈接轉換為txt文件,該怎么辦?

該文檔可能是指xml2包中的read_html()函數,該函數由同一作者Hadley Wickham在rvest包初始發布后rvest

因此,您必須按如下方式安裝和加載xml2包:

install.packages('xml2')
library('xml2')

url<-read_html("http://en.wikipedia.org/wiki/Brazil_national_football_team")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM