我正在尝试直接在R中下载Kaggle数据文件:
download.file("http://www.kaggle.com/c/walmart-recruiting-store-sales-forecasting/download/train.csv.zip", "/train.csv.zip")
Error in download.file("http://www.kaggle.com/c/walmart-recruiting-store-sales-forecasting/download/train.csv.zip", :
cannot open destfile '/train.csv.zip', reason 'Permission denied'附近有没有已知的步行街?
发布于 2014-03-19 16:08:35
您的destfile不正确。destfile是下载文件的目标位置(在您的计算机上)。我通常使用tempfile创建一个临时文件作为下载的目标,然后对其执行unlink操作。
tmp <- tempfile()
url <- "http://www.kaggle.com/c/walmart-recruiting-store-sales-forecasting/download/train.csv.zip"
download.file(url, destfile = tmp)然后检查list.files('tmp') (取决于tmp在您计算机上的位置),unzip它,读取它,一旦您将它读取到R中,就使用unlink(tmp)将它转储。
https://stackoverflow.com/questions/22499426
复制相似问题