这将是一个你将它视为FTP
的情况。
library(RCurl)
url = "https://www.ncei.noaa.gov/data/gsoy/access/"
filenames = getURL(url, dirlistonly = TRUE)
filenames <- strsplit(filenames, "\r\n")
filenames <- unlist(filenames)
download_filenames <- c("ZI000067781.csv", "ZI000067755.csv") #specify what files you want, do this in whatever way you desire, with a regex, list, etc.
sapply(download_filenames, function(x) {
download.file(paste(url, filename, sep = ""), paste(getwd(), "/", filename,
sep = ""))
}) #apply a download to your file names
您也可以连续将您想要的csv
读入数据帧。就像MrFlick说的那样,不确定你究竟想要什么。