Premium Feature — This feature supports RStudio, which is part of the Professional and Enterprise Editions of LabKey Server. Learn more or contact LabKey for details.

RStudio Workbench (previously RStudio Server Pro) supports running multiple RStudio sessions per user, and multiple versions of R simultaneously.

Prerequisite: Set Up RStudio Pro/Workbench

To set up RStudio Pro/Workbench to connect to LabKey, follow the instructions and guidance in this topic:

Once RStudio Pro/Workbench is correctly configured, the RStudio Pro/Workbench Admin should provide you with:
  • The absolute URL of RStudio Pro/Workbench
  • The Security Token customized to authenticate LabKey. Default is 'X-RStudio-Username'
You may also wish to confirm that RStudio Workbench was restarted after setting the above.

Configure RStudio Workbench in the Admin Console

  • Select (Admin) > Site > Admin Console.
  • Under Configuration, click Site Settings.
  • Set the Base Server URL (i.e. not "localhost").
  • Click Save.
  • Click Settings
  • Under Premium Features, click RStudio Settings.
  • Select Use RStudio Pro.

Enter the Configuration values:

  • RStudio Pro URL: The absolute URL of RStudio Pro/Workbench.
  • Authentication: Select either Email or Other User Attribute:
    • Email: Provide the User Email Suffix: Used for LabKey to RStudio Pro/Workbench user mapping. The RStudio Pro/Workbench user name is derived from removing this suffix (Ex. "@labkey.com") from the user's LabKey Server email address.
    • Other User Attribute: For example, LDAP authentication settings can be configured to retrieve user attributes at authentication time. Provide the Attribute Name for this option.
  • Security Token: The HTTP header name that RStudio is configured to use to indicate the authenticated user. Default is 'X-RStudio-Username'.
  • Initialize Schema Viewer: Check the box to enable the viewing of the LabKey schema from within RStudio. See Advanced Initialization of RStudio for more information.

Testing RStudio Pro/Workbench Connection

Before saving, you can use Test RStudio Pro to confirm the connection and security token. When successful the message will read:

RStudio Pro server connection test succeeded. Launch RStudio to verify $rStudioUserName$ is a valid RStudio user.

Proceed to launch RStudio Workbench via > Developer Links > RStudio Server. If the rstudioUserName you provided is valid, you will be logged in successfully. If not, you will see a warning message provided by RStudio Pro.

Note that previous versions of Rstudio Server Pro allowed LabKey to determine validity of the username. Find documentation for earlier versions in our archives: Testing RStudio Pro Connections

Troubleshooting unsuccessful results of Test RStudio Pro:

  • An error response may indicate the incorrect URL for RStudio Workbench was entered, or that URL is unreachable. Try reaching the URL in a browser window outside of LabKey.
  • A warning response may be due to an invalid security token.

Launch RStudio Workbench

  • Select (Admin) > Developer Links > RStudio Server.

When you launch RStudio Workbench, you will see your home page. If you have multiple sessions, click on one to select it.

Now you can use RStudio Workbench to edit R reports and export data. Learn more in these topics:

Related Topics

Discussion

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand all collapse all