R/RStudio installation using domain allowlisting

R/RStudio installation using domain allowlisting

Introduction

For general domain allowlisting setup, please read more here.
Certain software might need manual proxy configurations to be set in the software settings, before the software is able to reach domains through a proxy. In this article we describe how to manually configure R/RStudio proxy settings in order to install packages using domain allowlisting.

Windows virtual machines

Step 1: Request whitelisting domains through a ticket:  (see also document about domain allowlists per application here)

  1. posit.co (new domain for rstudio.com and rstudio.org)
  2. r-project.org
  3. domain of your choice for package repository (e.g. ac.at)
  4. rstudio.com (some network traffic is still rerouted to the old domain)
  5. rstudio.org (some network traffic is still rerouted to the old domain)

Step 2: Install R and RStudio as an administrator

Only Owners are able to install software in administrator mode (right click R or RStudio, run as admin)

Step 3: Proxy configurations within RStudio

  1. Open RStudio and write the following command to create a .Renviron file:
  1. file.edit('~/.Renviron')
  1. Add to the file two lines:


If you encounter the following error, please ignore, this should not affect your network traffic and is RStudio version specific:


  1. Restart RStudio
  2. In RStudio navigate to Tools > Global Options > Packages and disable Use secure download method for HTTP and click Apply

Step 4: Proxy configurations for R

In addition to setting up proxy configurations within RStudio, it is also necessary to setup proxy configurations for R. 
  1. Navigate to C:\Program Files\R\R-4.2.1 (or any other version)\etc and open .Renviron.site file with Notepad++
  1. If .Renviron.site is missing, create an empty text file with Notepad++ and name it .Renviron.site and place it in C:\Program Files\R\R-4.2.1 (or any other version)\etc
  1. Add the proxy configuration settings and click Save All.

The file has been saved successfully when the Save icon turns blue from being red:  > . It might be that it asks you to open Notepad++ again as Administrator. Click Yes and go to File > Save All. The icon should now turn blue.
  1. Navigate to C:\Program Files\R\R-4.2.1 (or any other version)\etc and open Rprofile.site file with Notepad++.
  1. Open this file with Notepad++ and add the proxy configuration settings and click Save All. 

The file has been saved successfully when the Save icon turns blue from being red:  > 

Installing packages should work now, if proper domains are whitelisted. 

Step 5: Install packages

If you carefully followed the instructions above, you should be able to install packages in R. We strongly advise to install packages in ADMIN mode (right click R or RStudio, run as admin), as this ensures the installed packages are available for any user accessing the Windows VM.
  1. Find Rstudio in the startmenu, right -click > More > click on Run as administrator;
  2. Install the required packages with:
install.packages(<packages>)
Be aware that packages may encounter compatibility challenges with specific versions of R/RStudio

If you find that you're still experiencing problems with installing packages, you can also include the line in your code:
options(repos = c(CRAN_mirror = "http://cran.r-project.org"))
Still not working? Add a ticket and ask for assistance of your local the Support Team on support.mydre.org.

We recommend you create a VM template after installations and proxy configurations. This way the configurations do not need to be configured later. 


    • Related Articles

    • R and RStudio using External Access rules

      For instruction on using R and RStudio using domain allowlisting (i.e., internet access based on domain instead of IP), see R/RStudio installation using domain allowlisting. R is an open-source programming language often used by researchers and data ...
    • Castor R-Package

      Prerequisites DRE: Owner access to workspace, to install R / RStudio / Rtools in a virtual machine External access to CRAN in the workspace where you want to export the data to (open up port rule) External access to Castor in the workspace where you ...
    • MATLAB / MathWorks installation and activation

      Introduction  This article links to knowledge base of MathWorks on how to install their products using network license and on offline machines.  See also: myDRE and Software Licenses If you have a working step-by-step procedure for yourself, please ...
    • Proxy configurations for connecting to a server or blob

      Version: 2022-11-02 Update: 2022-11-14 Introduction Domain allowlisting is a feature that is now available on myDRE. As the name implies, domains on the allowlist can be accessed from within the Workspace (you can request specific domain on the ...
    • [RESOLVED] Z: drive and domain allowlisting unavailable - Workaround for Z:

      Version: 2023-03-24 TL;DR The Z: drive was not visible in the myDRE Workspaces due to an issue at Microsoft leaving proxy instances in an unhealthy state. The issue has been resolved. We apologise for any inconvenience this might cause you. What ...