簡體   English   中英

如何使用AUTH從HTTP讀取R中的CSV

[英]How to read a CSV in R from HTTP with AUTH

我正在嘗試從具有authURL讀取帶有RCSV ,我確實有密碼以及我只需要知道要添加到命令中的所有內容,順便說一句,我的密碼確實包含@ char,所以它搞砸了我的方案[1]

這是我正在嘗試的命令:

products <- read.csv("http://username:pass@word@domain.com/api/products_by_date.csv?start_date=2011-04-01&end_date=2011-04-01", head=TRUE)

我的輸出是:

Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : unable to resolve 'username'

[1] scheme://username:password@domain:port/path?query_string#fragment_id

您可以在RCurl包中嘗試getURL ,它具有驗證HTTP請求的功能。 看看?getURL的例子。

暫無
暫無

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

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