Re: [R] http proxies: setting and unsetting
Thanks... I'll check the documentation to see which file on Windows I need to alter to issue one of those commands. matt -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 30, 2007 12:39 AM To: Gabor Grothendieck Cc: Pettis, Matthew (Thomson); r-help@stat.math.ethz.ch Subject: Re: [R] http proxies: setting and unsetting That was misleading advice. R is a C program and accesses the environment via the C calls getenv and (on Windows) putenv. This is not Windows scripting (Grothendieck's earlier reference): the C runtime maintains only one environment block. I've re-checked, and suspect the problem is in the following comment in ?download.file These environment variables must be set before the download code is first used: they cannot be altered later by calling 'Sys.setenv'. If I have http_proxy set in the environment, the proxy is not used in any of the following cases: - Calling R from a shortcut with http_proxy= on the target (see the rw-FAQ). - Calling R from a shortcut with no_proxy=* on the target. - Using Sys.unsetenv(http_proxy) right at the start of the R session. - Using Sys.setenv(no_proxy=*) right at the start of the R session. If you set options(internet.info=0) you will see exactly what is tried. Another possibility is that R is being used with --internet2, in which case none of this applies, and the simple answer is not to use --internet2 at home. On Tue, 29 May 2007, Gabor Grothendieck wrote: You can have 4 different http_proxy environment variables and if you set one type but try to unset a different type then that will have no effect on the one you originally set. For example, if you originally set it as a system or user environment variable and then try to unset the process environment variable of the same name then that will have no effect on the system or user environment variable. On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Gabor, Thanks for the reply and link. I took a look at the link -- one thing I don't understand is why if I delete the 'http_proxy' variable via the cmd shell (or equivalent OS dialog box), why I can get R to ignore the proxy, but using Sys.setenv(http_proxy=) won't do that for me (at least for the scope of the session). If there were other variables affecting it, I would think my deleting 'http_proxy' in the OS would also have no effect -- yet it does. Any ideas? Thanks again, Matt -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tue 5/29/2007 9:49 PM To: Pettis, Matthew (Thomson) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] http proxies: setting and unsetting Note that Windows XP has 4 types of environment variables and I suspect that the problem stems from not taking that into account: http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_kmmj.mspx ?mfr=true On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am trying to use R at work and at home on the same computer. At work, I have a proxy, and at home, I do not. I have, for work, a User environment variable http_proxy which I set in the OS (Windows XP Pro). When I am at work, and I try to retrieve data from the web with 'read.csv', things work just fine. I assume it knows how to use the proxy. The trouble is when I am at home and have no proxy, R still tries to use my work proxy. I have tried the following: Sys.setenv(http_proxy=) Sys.setenv(no_proxy=TRUE) Sys.setenv(no_proxy=1) none of which seems to work. Whenever I try to use read.csv, it tells me that it cannot find my work proxy, which I am trying to tell R to ignore. I can solve this problem by removing the http_proxy environment variable binding in the OS when at home, but that is a pain, because then I have to reset it when I go back into work. Is there a way to tell R within a session to ignore the proxy? If so, what am I doing wrong? thanks, matt __ 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. -- 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
Re: [R] http proxies: setting and unsetting
Thanks... I'll give it a whirl... matt -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 30, 2007 10:22 AM To: Pettis, Matthew (Thomson) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] http proxies: setting and unsetting There is also a free program setenv.exe which is more powerful than setx.exe. You mentioned that deleting http_proxy from your environment through the OS would fix your problem. setenv.exe can both set and delete environment variables and you can specify user, system, etc. See description and link here: http://www.jsifaq.com/SF/Tips/Tip.aspx?id=4928 Grothendieck [EMAIL PROTECTED] wrote: One other point. If you find you need to set a system or user environment variable then microsoft has a free tool called setx.exe that you can find here: http://support.microsoft.com/kb/927229 You can do this from within R using system(). On 5/30/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: OK, I think I get that... do you know which namespace the Sys.setenv() function affects? Do you know if there are functions in R that can alter the user/system/process environment variables? Use the R Sys.getenv() command to get the process environment variables. To get user and system environment variables, from the Desktop right click on My Computer and choose Properties. Then choose the Advanced tab and click on the Environment Variables button near the bottom of the window that appears. __ 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] http proxies: setting and unsetting
Hi, I am trying to use R at work and at home on the same computer. At work, I have a proxy, and at home, I do not. I have, for work, a User environment variable http_proxy which I set in the OS (Windows XP Pro). When I am at work, and I try to retrieve data from the web with 'read.csv', things work just fine. I assume it knows how to use the proxy. The trouble is when I am at home and have no proxy, R still tries to use my work proxy. I have tried the following: Sys.setenv(http_proxy=) Sys.setenv(no_proxy=TRUE) Sys.setenv(no_proxy=1) none of which seems to work. Whenever I try to use read.csv, it tells me that it cannot find my work proxy, which I am trying to tell R to ignore. I can solve this problem by removing the http_proxy environment variable binding in the OS when at home, but that is a pain, because then I have to reset it when I go back into work. Is there a way to tell R within a session to ignore the proxy? If so, what am I doing wrong? thanks, matt __ 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] http proxies: setting and unsetting
Hi Gabor, Thanks for the reply and link. I took a look at the link -- one thing I don't understand is why if I delete the 'http_proxy' variable via the cmd shell (or equivalent OS dialog box), why I can get R to ignore the proxy, but using Sys.setenv(http_proxy=) won't do that for me (at least for the scope of the session). If there were other variables affecting it, I would think my deleting 'http_proxy' in the OS would also have no effect -- yet it does. Any ideas? Thanks again, Matt -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tue 5/29/2007 9:49 PM To: Pettis, Matthew (Thomson) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] http proxies: setting and unsetting Note that Windows XP has 4 types of environment variables and I suspect that the problem stems from not taking that into account: http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_kmmj.mspx?mfr=true On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am trying to use R at work and at home on the same computer. At work, I have a proxy, and at home, I do not. I have, for work, a User environment variable http_proxy which I set in the OS (Windows XP Pro). When I am at work, and I try to retrieve data from the web with 'read.csv', things work just fine. I assume it knows how to use the proxy. The trouble is when I am at home and have no proxy, R still tries to use my work proxy. I have tried the following: Sys.setenv(http_proxy=) Sys.setenv(no_proxy=TRUE) Sys.setenv(no_proxy=1) none of which seems to work. Whenever I try to use read.csv, it tells me that it cannot find my work proxy, which I am trying to tell R to ignore. I can solve this problem by removing the http_proxy environment variable binding in the OS when at home, but that is a pain, because then I have to reset it when I go back into work. Is there a way to tell R within a session to ignore the proxy? If so, what am I doing wrong? thanks, matt __ 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.
Re: [R] http proxies: setting and unsetting
OK, I think I get that... do you know which namespace the Sys.setenv() function affects? Do you know if there are functions in R that can alter the user/system/process environment variables? Thanks, Matt -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tue 5/29/2007 10:20 PM To: Pettis, Matthew (Thomson) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] http proxies: setting and unsetting You can have 4 different http_proxy environment variables and if you set one type but try to unset a different type then that will have no effect on the one you originally set. For example, if you originally set it as a system or user environment variable and then try to unset the process environment variable of the same name then that will have no effect on the system or user environment variable. On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Gabor, Thanks for the reply and link. I took a look at the link -- one thing I don't understand is why if I delete the 'http_proxy' variable via the cmd shell (or equivalent OS dialog box), why I can get R to ignore the proxy, but using Sys.setenv(http_proxy=) won't do that for me (at least for the scope of the session). If there were other variables affecting it, I would think my deleting 'http_proxy' in the OS would also have no effect -- yet it does. Any ideas? Thanks again, Matt -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tue 5/29/2007 9:49 PM To: Pettis, Matthew (Thomson) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] http proxies: setting and unsetting Note that Windows XP has 4 types of environment variables and I suspect that the problem stems from not taking that into account: http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_kmmj.mspx?mfr=true On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am trying to use R at work and at home on the same computer. At work, I have a proxy, and at home, I do not. I have, for work, a User environment variable http_proxy which I set in the OS (Windows XP Pro). When I am at work, and I try to retrieve data from the web with 'read.csv', things work just fine. I assume it knows how to use the proxy. The trouble is when I am at home and have no proxy, R still tries to use my work proxy. I have tried the following: Sys.setenv(http_proxy=) Sys.setenv(no_proxy=TRUE) Sys.setenv(no_proxy=1) none of which seems to work. Whenever I try to use read.csv, it tells me that it cannot find my work proxy, which I am trying to tell R to ignore. I can solve this problem by removing the http_proxy environment variable binding in the OS when at home, but that is a pain, because then I have to reset it when I go back into work. Is there a way to tell R within a session to ignore the proxy? If so, what am I doing wrong? thanks, matt __ 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.