我是一個R和編程福利局,並試圖從下載文件:download.file中的錯誤;沒有這樣的文件或目錄
https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv
我用download.file和我的代碼是:
網址< - 'https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv '
DOC < -download.file(URL,destfile ='/測試/ communities.csv')
我得到一個錯誤:
錯誤download.file(URL,destfile = 「./test/communities.csv」): 無法打開destfile './test/communities.csv',原因 '沒有這樣的文件或目錄'
但是當我檢查使用getwd()我的工作目錄就說明它的存在:
getwd() [1] "C:/Users/puneet.kumar/Desktop/R practice/R lesson/Data cleaning/test"
能否請你幫我這個。預先感謝您的幫助。
測試文件夾中可能沒有測試文件夾。因此,使用'destfile ='communities.csv''或'destfile ='../test/communities.csv''。 – lukeA