Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for

Software Release 4.5 October 2018

Two-Second Advantage® 2

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. ANY SOFTWARE ITEM IDENTIFIED AS THIRD PARTY LIBRARY IS AVAILABLE UNDER SEPARATE SOFTWARE LICENSE TERMS AND IS NOT PART OF A TIBCO PRODUCT. AS SUCH, THESE SOFTWARE ITEMS ARE NOT COVERED BY THE TERMS OF YOUR AGREEMENT WITH TIBCO, INCLUDING ANY TERMS CONCERNING SUPPORT, MAINTENANCE, WARRANTIES, AND INDEMNITIES. DOWNLOAD AND USE THESE ITEMS IS SOLELY AT YOUR OWN DISCRETION AND SUBJECT TO THE LICENSE TERMS APPLICABLE TO THEM. BY PROCEEDING TO DOWNLOAD, INSTALL OR USE ANY OF THESE ITEMS, YOU ACKNOWLEDGE THE FOREGOING DISTINCTIONS BETWEEN THESE ITEMS AND TIBCO PRODUCTS. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc.

TIBCO, Two-Second Advantage, TIBCO Spotfire, TIBCO Enterprise Runtime for R, TIBCO Spotfire Server, TIBCO Spotfire Web Player, TIBCO Spotfire Statistics Services, S-PLUS, and TIBCO Spotfire S+ are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. Enterprise Beans (EJB), Java Platform Enterprise Edition (Java EE), Java 2 Platform Enterprise Edition (J2EE), and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle Corporation in the U.S. and other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 3

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright © 2010-2018 TIBCO Software Inc. All rights reserved. TIBCO Software Inc. Confidential Information

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 4

Contents

Documentation and support services ...... 5 Configure RStudio to use TIBCO Enterprise Runtime for R ...... 6 Configuring RStudio Windows desktop edition to run the TIBCO Enterprise Runtime for R engine ...... 6 Configuring RStudio Mac desktop edition to run the TIBCO Enterprise Runtime for R engine ...... 6 Configuring RStudio desktop edition to run the TIBCO Enterprise Runtime for R engine ...... 7 Configuring RStudio Linux server edition to run the TIBCO Enterprise Runtime for R engine ...... 7 Unsupported features for using TERR with RStudio ...... 7 Troubleshooting RStudio with TIBCO Enterprise Runtime for R ...... 8

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 5

Documentation and support services

How to Access TIBCO Documentation

Documentation for TIBCO products is available on the TIBCO Product Documentation website, mainly in HTML and PDF formats. The TIBCO Product Documentation website is updated frequently and is more current than any other documentation included with the product. To access the latest documentation, visit https:// docs.tibco.com.

System Requirements for Spotfire Products

For information about the system requirements for Spotfire products, visit http://spotfi.re/sr.

TIBCO Enterprise Runtime for R documentation

The following documents for TIBCO® Enterprise Runtime for R can be found in the TIBCO Product Documentation website.

● TIBCO® Enterprise Runtime for R Technical Documentation

● Language Reference (HTML)

● Differences Between TIBCO® Enterprise Runtime for R and Open-Source R (HTML)

● Release Notes (PDF)

● License Agreement (PDF) The following documents for integrating with third-party products are also available in PDF format.

● Technical Note: Configure KNIME to use TIBCO® Enterprise Runtime for R

● Technical Note: Configure RStudio to use TIBCO® Enterprise Runtime for R

● Technical Note: Configure SparkR to use TIBCO® Enterprise Runtime for R

How to Contact TIBCO Support

You can contact TIBCO Support in the following ways:

● For an overview of TIBCO Support, visit http://www.tibco.com/services/support.

● For accessing the Support Knowledge Base and getting personalized content about products you are interested in, visit the TIBCO Support portal at https://support.tibco.com.

● For creating a Support case, you must have a valid maintenance or support contract with TIBCO. You also need a user name and password to log in to https://support.tibco.com. If you do not have a user name, you can request one by clicking Register on the website.

How to Join TIBCO Community

TIBCO Community is the official channel for TIBCO customers, partners, and employee subject matter experts to share and access their collective experience. TIBCO Community offers access to Q&A forums, product wikis, and best practices. It also offers access to extensions, adapters, solution accelerators, and tools that extend and enable customers to gain full value from TIBCO products. In addition, users can submit and vote on feature requests from within the TIBCO Ideas Portal. For a free registration, go to https://community.tibco.com. For quick access to the TIBCO® Enterprise Runtime for R content, see https://community.tibco.com/ products/terr

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 6

Configure RStudio to use TIBCO Enterprise Runtime for R

You can use the RStudio™ integrated development environment (IDE) to write TIBCO® Enterprise Runtime for R (TERR™) scripts, expressions, and data functions.

RStudio is a full-featured, open-source IDE for working with R code. It is provided independently of TIBCO Software Inc. You can learn more about RStudio, and you can download and use RStudio for your development at www.rstudio.com. RStudio is available under separate open-source software license terms. TIBCO does not warrant, deliver, or support code or other material provided by RStudio, Inc., including but not limited to development tools and packages, and such code or other material does not constitute a part of the TERR engine. TERR has been tested with RStudio 1.1.453 release on the following platforms:

● Using the Windows desktop version of the RStudio IDE.

● Using the Mac desktop version of the RStudio IDE.

● Using the Linux desktop version of th RStudio IDE.

● Accessing the RStudio IDE Server, and then executing code remotely via a . For current information about the versions of RStudio against which we have tested the TERR engine, see the Spotfire Support system requirements page at http://support.spotfire.com/sr.asp.

Configuring RStudio Windows desktop edition to run the TIBCO Enterprise Runtime for R engine Configure the Windows desktop version of the RStudio IDE to work with TERR. Perform this task from the Windows desktop.

Prerequisites

You must have installed RStudio version 0.99 or later for the Windows desktop. (See http:// support.spotfire.com/sr.asp for tested versions.) Due to a change in RStudio for Windows between versions 1.1.136 and 1.1.336, using TERR to print (for example, print(1:1000)) runs extremely slowly. If you experience this problem, then in your RStudio session, set options(error=NULL).

Procedure

1. From the Windows Start menu, launch RStudio. 2. From within RStudio, on the menu, click Tools > Global Options. 3. In the General tab, set the R version to your installation of TERR.

For example, :\Program Files\TIBCO\terr45. 4. Click Apply, and then restart RStudio.

Configuring RStudio Mac desktop edition to run the TIBCO Enterprise Runtime for R engine You can use TERR in your RStudio installation on your Mac OS X®. Perform this task from your Mac desktop.

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 7

Prerequisites

● You must be running Mac OS X version 10.10 or later.

● You must have installed RStudio version 0.99 or later for the Mac desktop. See http:// support.spotfire.com/sr.asp for tested versions.

● You must have installed TERR version 4.5 on your Mac OS X. See Installing and running TIBCO Enterprise Runtime for R on a Mac OS X in the Technical Guide for more information.

Procedure

1. On your Mac, open a Terminal session.

2. At the command prompt, type RStudio-TERR. RStudio launches with TERR as the language engine.

Configuring RStudio Linux desktop edition to run the TIBCO Enterprise Runtime for R engine Configure the Linux desktop version of the RStudio IDE to work with TERR. Perform this task from the Linux desktop.

Prerequisites

You must have installed RStudio version 0.99 or later for the Linux desktop. (See http:// support.spotfire.com/sr.asp for tested versions.)

Procedure

● Linux RStudio desktop users should follow the instructions for specifying the R version for Linux in the RStudio documentation, found at https://support.rstudio.com/hc/en-us/articles/200486138- Using-Different-Versions-of-R.

Configuring RStudio Linux server edition to run the TIBCO Enterprise Runtime for R engine Configure the Linux server version of the RStudio IDE to work with TERR. Perform this task from the Linux server.

Prerequisites

You must have installed RStudio version 0.99 or later for the Linux server. (See http:// support.spotfire.com/sr.asp for tested versions.)

Procedure

● Linux Server administrators should follow the instructions under Specifying R Version in the RStudio Server configuration documentation, found at https://support.rstudio.com/hc/en-us/articles/ 200552316. Unsupported features for using TERR with RStudio Some features available for open-source R in RStudio are not supported for using TERR.

● On Linux, you cannot save Command History to a file.

● Plots are not supported in TERR. The Plots tab produces no plot.

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 8

● Rcpp integration is currently not supported.

● The following file types, listed in the RStudio File > New menu, are not supported if you are using TERR as your engine.

— C++ File

— R

— R HTML

— Shiny Web App

— R Presentation Troubleshooting RStudio with TIBCO Enterprise Runtime for R If you have problems configuring RStudio with TERR, check for advice in this topic. When I configured RStudio on Windows to point to TERR instead of open-source R, I see a blank GUI. You might see a blank user interface with a version of TERR older than version 4.2. This can occur if the version of RStudio you have installed is not compatible with TERR. Follow these steps to fix the problem.

1. In Windows Explorer, go to C:\Users\currentUser\AppData\Roaming\RStudio.

2. Delete the file Desktop.ini. This technique forces RStudio to refresh and default to open-source R as the engine.

3. Go to the requirements page for your version of TERR and note the version of RStudio for which it was tested. See http://support.spotfire.com/sr.asp, and in the All product system requirements drop-down list box, select TIBCO Enterprise Runtime for R (TERR). 4. Download and install that version of RStudio. 5. After you have the version of RStudio that is compatible with your version of TERR, follow the steps to point RStudio to your installation of TERR.

When I try to use an RStudio feature with TERR that requires the rmarkdown or shiny packages, RStudio tries to download the packages but fails. If the rmarkdown or the shiny packages are not already installed, and if you try to use an RStudio feature that requires one or both of these packages, RStudio prompts to install them automatically. This process currently fails if RStudio is configured with the TERR engine. To work around this problem, at the command prompt, call install.packages() to install the rmarkdown and shiny packages. When I click Help > Check for Updates, nothing happens. When RStudio is configured with TERR, the menu item Help > Check for Updates does nothing. To check for updates to RStudio from this menu item, you must change the RStudio configuration to run open-source R.

An easy way to select an engine for RStudio is to hold down Ctrl while you start RStudio. This action displays the dialog for choosing a different R engine. You can select TERR in this dialog.

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R 9

Index

B binary 7 P blank GUI 8 plots 7

C R C code 7 R Presentation 7 C++ 7 Rcpp integration 7 Check for updates 8 Check for Updates 8 command history 7 S Shiny 7 F SWeave 7 7 V L version 6 Linux desktop 7 Linux server 7 W M Windows 6 Mac 6

Technical Note: Configure RStudio® to use TIBCO® Enterprise Runtime for R