[R] read.table opening a website incl Password
Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do that? Or is it not possible to this in R? I tried something like this mydata.frame - read.table(myusr:[EMAIL PROTECTED]/adir/afile.txt) but it did not work. I'd appreciate any hints. My platform is Win32 (and I am actually running R 2.3.1, but I guess (hope!) this is not the reason. At least I checked the NEWS file whether any changes appeared since 2.3.1 which could affect this behavior). Thanks, Roland __ R-help@stat.math.ethz.ch 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.
Re: [R] read.table opening a website incl Password
Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do that? Or is it not possible to this in R? I tried something like this mydata.frame - read.table(myusr:[EMAIL PROTECTED]/adir/afile.txt) but it did not work. I'd appreciate any hints. My platform is Win32 (and I am actually running R 2.3.1, but I guess (hope!) this is not the reason. At least I checked the NEWS file whether any changes appeared since 2.3.1 which could affect this behavior). In what way did it not work? The following seems to work for me: read.table(ftp://myusr:[EMAIL PROTECTED]/mydir/test.dat) Thanks, Roland __ R-help@stat.math.ethz.ch 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. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894 __ R-help@stat.math.ethz.ch 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.
Re: [R] read.table opening a website incl Password
On Wed, 16 May 2007, Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do that? Or is it not possible to this in R? I tried something like this mydata.frame - read.table(myusr:[EMAIL PROTECTED]/adir/afile.txt) but it did not work. Well, it could not. You need ftp:// or http:// for this to be a URL. This ought to work for ftp:, but AFAIK not for http:. You could always try --internet2: if it works in IE, it will probably also work in R. I'd appreciate any hints. My platform is Win32 (and I am actually running R 2.3.1, but I guess (hope!) this is not the reason. At least I checked the NEWS file whether any changes appeared since 2.3.1 which could affect this behavior). Thanks, Roland __ R-help@stat.math.ethz.ch 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. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch 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.
Re: [R] read.table opening a website incl Password
Chuck, Roland is trying to read from a web site instead of a ftp site. I have also gotten this to work: read.table(ftp://myusr:[EMAIL PROTECTED]/mydir/test.dat) But when I try to do the same thing from the SEC's ftp site I get an error, so beyond R, there may be some internet settings that need to be fiddled with. Maybe I can tag onto Roland's question and ask for hints on what configuration options are available? Thanks, Roger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chuck Cleland Sent: Wednesday, May 16, 2007 1:08 PM To: Roland Rau Cc: r-help@stat.math.ethz.ch Subject: Re: [R] read.table opening a website incl Password Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do that? Or is it not possible to this in R? I tried something like this mydata.frame - read.table(myusr:[EMAIL PROTECTED]/adir/afile.txt) but it did not work. I'd appreciate any hints. My platform is Win32 (and I am actually running R 2.3.1, but I guess (hope!) this is not the reason. At least I checked the NEWS file whether any changes appeared since 2.3.1 which could affect this behavior). In what way did it not work? The following seems to work for me: read.table(ftp://myusr:[EMAIL PROTECTED]/mydir/test.dat) Thanks, Roland __ R-help@stat.math.ethz.ch 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. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894 __ R-help@stat.math.ethz.ch 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. ** * 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. __ R-help@stat.math.ethz.ch 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.
Re: [R] read.table opening a website incl Password
Dear all, so far I tried various things but I did not really succeed: - starting R with --internet2 - using url() - using read.table(http://myusr:[EMAIL PROTECTED]/adir/afile.txt) I just have an idea what the problem could be for me: The username is actually an email address. So the '@'-character has some ambiguous meaning in my setting. Sorry that I did not think of that beforehand. Thank you very much for your help, Roland Prof Brian Ripley wrote: On Wed, 16 May 2007, Roland Rau wrote: Dear all, in the past I have been able to access websites with data directly. For example the following code works nicely mydata - read.table(http://www.lifetable.de/data/MPIDR/POL_2004.txt;, header=TRUE) But what happens if I need a username and password (a different site)? How do I do that? Or is it not possible to this in R? I tried something like this mydata.frame - read.table(myusr:[EMAIL PROTECTED]/adir/afile.txt) but it did not work. Well, it could not. You need ftp:// or http:// for this to be a URL. This ought to work for ftp:, but AFAIK not for http:. You could always try --internet2: if it works in IE, it will probably also work in R. I'd appreciate any hints. My platform is Win32 (and I am actually running R 2.3.1, but I guess (hope!) this is not the reason. At least I checked the NEWS file whether any changes appeared since 2.3.1 which could affect this behavior). Thanks, Roland __ R-help@stat.math.ethz.ch 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. __ R-help@stat.math.ethz.ch 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.