title: R 3.1.0 Trouble installing Bioconductor package
body: <p><strong>Update</strong></p>
  
  <p>I posted a working fix below. It doesn't completely solve the problem, but it is a work around. I would still like to get it working, so if anyone adds a better solution, I'll select it!</p>
  
  <h2>Problem</h2>
  
  <p>I am trying to set environment variables in R in order to connect through a proxy, but nothing I do seems to work. (edit: I have done everything I have found suggested in other similar posts, which is usually via setting <code>http_proxy</code> or variants in some manner)</p>
  
  <p>Here is my <code>sessionInfo()</code></p>
  
  <pre><code>&gt; sessionInfo()
  R version 3.1.0 (2014-04-10)
  Platform: x86_64-apple-darwin13.1.0 (64-bit)
  
  locale:
  [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  loaded via a namespace (and not attached):
  [1] tools_3.1.0
  </code></pre>
  
  <p>I have tried:</p>
  
  <ol>
  <li>setting 'http_proxy' (including all caps and https variations) in .Renviron and .Rprofile</li>
  <li>setting the proxy variables in the terminal.</li>
  <li>setting the proxy variables via <code>Sys.setenv(http_proxy="SERVER:PORT")</code></li>
  <li>all of the above for both RStudio and command line R</li>
  </ol>
  
  <p>Yet, the variable is not set:
  <em>Edit: Martin Morgan pointed out that I needed quotations in the <code>getenv</code> call. The variable is set.</em></p>
  
  <pre><code>&gt; Sys.getenv(http_proxy)
  [1] ""
  &gt; Sys.setenv(http_proxy="SERVER:PORT")
  &gt; Sys.getenv(http_proxy)
  [1] ""
  </code></pre>
  
  <p>Still, it seems to be able to connect to the proxy, but no matter what I do, I get some variation of the following:</p>
  
  <pre><code>&gt; options(internet.info=0)
  &gt; source("http://bioconductor.org/biocLite.R")
  Error in file(filename, "r", encoding = encoding) : 
    cannot open the connection
  In addition: Warning messages:
  1: In file(filename, "r", encoding = encoding) :
    connected to 'SERVER' on port PORT.
  2: In file(filename, "r", encoding = encoding) :
    -&gt; (Proxy) GET http://bioconductor.org/biocLite.R HTTP/1.0
  Host: bioconductor.org
  Pragma: no-cache
  User-Agent: R (3.0.3 x86_64-apple-darwin13.1.0 x86_64 darwin13.1.0)
  
  3: In file(filename, "r", encoding = encoding) : &lt;- HTTP/1.1 404 Not Found
  4: In file(filename, "r", encoding = encoding) :
    &lt;- Content-Type: text/html
  5: In file(filename, "r", encoding = encoding) :
    &lt;- Date: Wed, 14 May 2014 18:10:32 GMT
  6: In file(filename, "r", encoding = encoding) : &lt;- Connection: close
  7: In file(filename, "r", encoding = encoding) : &lt;- Server: mwg-ui
  8: In file(filename, "r", encoding = encoding) :
    Code 404, content-type 'text/html'
  9: In file(filename, "r", encoding = encoding) :
    cannot open: HTTP status was '404 Not Found'
  </code></pre>
  
  <p>You will notice that in the case listed above, I get a <code>404</code> error; however, I can (and did) access the file in browser. I tried running it as well:</p>
  
  <pre><code>&gt; source("~/Downloads/biocLite.R")
  Warning: unable to access index for repository http://www.bioconductor.org/packages/2.14/bioc/src/contrib
  'biocLite.R' failed to install 'BiocInstaller', use
    'install.packages("BiocInstaller",
    repos="http://www.bioconductor.org/packages/2.14/bioc")'
  Warning message:
  package ‘BiocInstaller’ is not available (for R version 3.1.0) 
  &gt; install.packages("BiocInstaller",
  +   repos="http://www.bioconductor.org/packages/2.14/bioc")
  Warning: unable to access index for repository http://www.bioconductor.org/packages/2.14/bioc/src/contrib
  Warning message:
  package ‘BiocInstaller’ is not available (for R version 3.1.0) 
  </code></pre>
  
  <p>Update: Tried downloading <code>http://bioconductor.org/biocLite.R</code> via <code>wget</code> and <code>curl</code> from the command line. Works just fine.</p>
  
  <p>Update: I tried a couple of things after suggestions from different sources.</p>
  
  <ol>
  <li><p>Put single quotes around the values in the <code>.Renviron</code> file, i.e., `http_proxy='SERVER:PORT'.
  This changed something, but still no success. Also, I found out that the url quotes need to be double.</p>
  
  <blockquote>
    <p>source('<a href="http://bioconductor.org/biocLite.R" rel="nofollow">http://bioconductor.org/biocLite.R</a>')
    Error in file(filename, "r", encoding = encoding) : 
      cannot open the connection
    source("<a href="http://bioconductor.org/biocLite.R" rel="nofollow">http://bioconductor.org/biocLite.R</a>")
    Warning: unable to access index for repository <a href="http://www.bioconductor.org/packages/2.14/bioc/src/contrib" rel="nofollow">http://www.bioconductor.org/packages/2.14/bioc/src/contrib</a>
    'biocLite.R' failed to install 'BiocInstaller', use
      'install.packages("BiocInstaller",
      repos="http://www.bioconductor.org/packages/2.14/bioc")'
    Warning message:
    package ‘BiocInstaller’ is not available (for R version 3.1.0) </p>
  </blockquote></li>
  <li><p>With an empty .Renviron file and a fresh terminal, run <code>R --vanilla</code> and install. This was intended to ensure that the proxy needed to be set. And it does.</p>
  
  <blockquote>
    <p>source('<a href="http://bioconductor.org/biocLite.R" rel="nofollow">http://bioconductor.org/biocLite.R</a>')
    Error in file(filename, "r", encoding = encoding) : 
      cannot open the connection
    In addition: Warning message:
    In file(filename, "r", encoding = encoding) :
      unable to connect to 'bioconductor.org' on port PORT.</p>
  </blockquote></li>
  <li><p>Use quotes around the <code>Sys.getenv</code> call: [worked, but doesn't fix the problem]</p>
  
  <blockquote>
    <p>Sys.getenv("http_proxy")
    [1] "http:// SERVER : PORT /"</p>
  </blockquote></li>
  </ol>