Hello,

You have an extra "argument" to getURL that is _not_ an argument: 
ftp://ftp.use.epsv/
To get the list of files just do

url <- "ftp://ftp.cpc.ncep.noaa.gov/fews/AFR_CLIM/ARC2/DATA/1985/";
filenames <- getURL(url, dirlistonly = TRUE)
fn <- unlist(strsplit(filenames, "\r\n"))

# To download the files
destdir <- "C:/Rui/Temp/"  # Adapt to your system
lapply(fn, function(x) download.file(paste0(url, x), paste0(destdir, x)))


Hope this helps,

Rui Barradas
Em 16-01-2013 22:41, Peter Maclean escreveu:
>   
> I want to download and unzip many files from the FTP and create variables for 
> year, month, and day for each file based on the naming mechanism. I am stack 
> with the following lines and any help will be highly appreciated. I want to 
> create a spreadsheet file with lat lon and estimate as headers.
>   
> library(RCurl)
> # Download the files for 1985.
> url = "ftp://ftp.cpc.ncep.noaa.gov/fews/AFR_CLIM/ARC2/DATA/1985/";
> filenames = getURL(url, ftp://ftp.use.epsv/ = FALSE, dirlistonly = TRUE)
> crlf = TRUE
>
>
> Peter Maclean
> Department of Economics
> UDSM
>       [[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to