[R] FTP download from ftp.sec.gov

Bos, Roger roger.bos at us.rothschild.com
Thu Mar 1 23:53:26 CET 2007


I have managed to download files from web sites and ftp sites using R,
so just for fun I tried to do so from the SEC's ftp site using the
following code:

ftp <- "ftp://anonymous:test@ftp.sec.gov/edgar/full-index/company.idx"
download.file(url=ftp, destfile="test.txt")

And it does not work.  R says it cannot open the URL. If I paste the ftp
part into IE it works fine.  Its not critical, but I would be interested
if anything figures out how to make it work.  (I know R is probably not
the best language for FTP download and text parsing, but that's another

Thanks, Roger

********************************************************************** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

More information about the R-help mailing list