我正在尝试批量下载一系列网址。到目前为止,我的代码是在R中搜索一系列网址
link <- paste("http://portal.hud.gov/hudportal/documents/huddoc? id=RAD_PHAApp_", state, ".xls", sep = "")
state <- c('al','tx')
download.file(link, paste(destfile = 'Y:\\PBlack\\RAD\\', state, '.xls', sep = ""), mode = 'wb')
的想法在这里,我可以名称添加到状态值,它会下载并命名它们的状态。
R运行代码时返回以下内容。
Warning messages:
1: In download.file(link, paste(destfile = "Y:\\PBlack\\RAD\\", state, :
only first element of 'url' argument used
2: In download.file(link, paste(destfile = "Y:\\PBlack\\RAD\\", state, :
only first element of 'destfile' argument used
是否应该在第一个URL中的'huddoc?'和'id'之间存在空格? – TARehman