好的,所以這是OSX特有的R問題。R for OSX中的問題與download.file函數
我試圖通過API下載XML數據。下面的代碼在PC上運行得很好,但不是在Mac上。我旋轉了所有的「方法」(捲曲等)無濟於事。有什麼想法嗎?
tempx <- "temp.xml"
url <- "http://usaspending.gov/fpds/fpds.php?detail=b&fiscal_year=2012&maj_agency_cat=97&max_records=10&sortby=d&records_from=1"
download.file(url, tempx, method="auto")
ETA:這是我的錯誤:
trying URL 'http://usaspending.gov/fpds/fpds.php?detail=b&fiscal_year=2012&maj_agency_cat=97&max_records=10&sortby=d&records_from=1'
Error in download.file(url, tempx, method = "auto") :
cannot open URL 'http://usaspending.gov/fpds/fpds.php?detail=b&fiscal_year=2012&maj_agency_cat=97&max_records=10&sortby=d&records_from=1'
你怎麼得到的錯誤? – agstudy
查看包XML解析XML和RCurl捲曲 –