首页 > 解决方案 > R编程中的download.file

问题描述

我试图从函数“download.file”下载文件,当我尝试编写这段代码时发现了这个问题

fileurl1<-"https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileUrl1, destfile = "./C:/Users/DELL/Desktop")

download.file 中的错误(fileUrl1,destfile = “./C:/Users/DELL/Desktop”):无法打开 destfile './C:/Users/DELL/Desktop',原因是“参数无效”

标签: r

解决方案


Destination 必须是 csv 文件的路径,而不是文件夹的路径。尝试 :

download.file(fileurl1, './C:/Users/DELL/Desktop/temp.csv')

推荐阅读