あなたは、低速接続で明示的なタイムアウトを設定する必要があります。
library(httr)
library(rvest)
pg <- GET("https://inciweb.nwcg.gov/", timeout(60))
incidents <- html_table(content(pg))[[1]]
str(incidents)
## 'data.frame': 10 obs. of 7 variables:
## $ Incident: chr "Highline Fire" "Cottonwood Fire" "Rattlesnake Point Fire" "Coolwater Complex" ...
## $ Type : chr "Wildfire" "Wildfire" "Wildfire" "Wildfire" ...
## $ Unit : chr "Payette National Forest" "Elko District Office" "Nez Perce - Clearwater National Forests" "Nez Perce - Clearwater National Forests" ...
## $ State : chr "Idaho, USA" "Nevada, USA" "Idaho, USA" "Idaho, USA" ...
## $ Status : chr "Active" "Active" "Active" "Active" ...
## $ Acres : chr "83,630" "1,500" "4,843" "2,969" ...
## $ Updated : chr "1 min. ago" "1 min. ago" "3 min. ago" "5 min. ago" ...
一時的な回避策
l <- charToRaw(paste0(readLines("https://inciweb.nwcg.gov/"), collapse="\n"))
pg <- read_html(l)
html_table(pg)[[1]]
フム、別のタイムアウト(#)とこれを取得しておくことを試してみました: 'pg < - GET(" https://inciweb.nwcg.gov/ "、タイムアウト(60)) curl :: curl_fetch_memory(url、handle = handle)のエラー: タイムアウトに達しました:10000ミリ秒後に接続がタイムアウトしました。 ' – S31
私はRで他のウェブサイトも試しましたが、同じ問題がありました。ブラウザでこれらのサイトにアクセスすると、通常 – S31
のように動作します。 Windows 7を使用する – S31