2
我有這個函數不會運行。代碼內部的命令在它自己應用時起作用,但是當我在這個lapply函數中運行它時,它會出錯。我試圖更新我的捲曲庫等...不知道爲什麼發生。R - curl :: curl_fetch_memory(url,handle = handle)中的錯誤:使用錯誤/非法格式或丟失URL的URL
library(curl)
##dataframe looks like this as factor list: x = "http://google.com"
funk <- function(x) {
read_html(x) %>% html_node("title") %>% html_text
}
df$titles<-lapply(df$urls,funk)
Error: 'Error in curl::curl_fetch_memory(url, handle = handle) :
URL using bad/illegal format or missing URL
' does not exist in current working directory ('/Users/Home/').
任何幫助表示讚賞。
更新。數據框是一個URL列表,就像上面的例子中的因子列表一樣。 – frameworkgeek
脅迫人格?沒有看到網址就無法診斷。 – alistaire
@alistaire是在樂譜裏試過as.character(df $ urls),沒有運氣 – frameworkgeek