[R] problems with download.file() from ftp?

zack holden zack_holden at hotmail.com
Mon Jan 12 15:51:22 CET 2009


Dear list,
 
I am trying to download a text file from an ftp site using download.file().
 
I used the following code:
url <- "ftp://ftp.wcc.nrcs.usda.gov/data/snow/snow_course/table/history/idaho/13e19.txt"
dest <- "c:/test/downloadtest.txt"
download.file(url, dest)
I get this error message, indicating that R is unable to open the connection:
trying URL 'ftp://ftp.wcc.nrcs.usda.gov/data/snow/snow_course/table/history/idaho/13e19.txt'
Error in download.file(url, dest) : 
  cannot open URL 'ftp://ftp.wcc.nrcs.usda.gov/data/snow/snow_course/table/history/idaho/13e19.txt'
 
I'm sure there is a simple solution that allows R to open this connection, but after reading the "url" help file for an hour, I can't seem to find the solution. Is anyone willing to help me solve this problem? 
 
thanks in advance for any advice,
 
Zack

 



More information about the R-help mailing list