Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ModelOp Center provides plugins into common data science development tools such as Rstudio, to allow data scientists to interact with ModelOp Center from their preferred development environment.

Introduction

ModelOp Center provides plugins into common data science development tools such as RStudio, to allow data scientists to interact with ModelOp Center from their preferred development environment.

Using ModelOp Center RStudio Plugin

RStudio (https://rstudio.com/) is a popular tool among data scientists and other users of R for building models. It includes a console, syntax-highlighting editor that supports direct code execution, as well as tools for plotting, history, debugging and workspace management. It comes in two formats: RStudio Desktop and RStudio Server. For the purposes of the interaction between ModelOp Center and RStudio we have the RStudio addin available which makes it easier to make some of the most useful operations directly in the user’s IDE of choice, in this case, RStudio notebook.

Installation and configuration instructions

Include PageRStudio addin installation and configurationRStudio addin installation and configuration

ModelOp Center contains a package with the RStudio addin installation “tar.gz” file. Please contact your ModelOp representative to get the latest version.

Installation

These installation instructions assume the following:

  • RStudio is already installed in any of the two formats: RStudio Desktop or RStudio Server.

  • If you are installing from source code repository (as opposed to already having the tar.gz file).

    • Maven is already installed.

    • You have access to ModelOp’s rstudio-addin github repository.

If you don’t already have the tar.gz installable file but have access to the repository:

Code Block
git clone https://github.com/modelop/rstudio-addin.git
cd rstudio-addin
mvn clean install

Then open RStudio or your R shell and make sure you have the required installation dependency: devtools

Code Block
languager
install.packages("devtools")

Install the ModelOp RStudio addin:

Code Block
languager
devtools::install_local("rstudio-addin-2.1-SNAPSHOT.tar.gz")
Note

Watch out for when you just recently installed the package, you may need to restart the R session in order to see the package’s addins.

Configuration

Before being able to use the addin in your RStudio instance, please make sure your RStudio knows where your ModelOp Center can be reached by providing the base URL in either of the following ways.

  1. Setting up the MOC_INSTANCE_URL environment variable with the base URL, e.g.: http://modelop:8090 before running the RStudio Server or before opening RStudio Desktop (from a terminal). Please note for RStudio Server installations that the environment variables aren’t automatically passed to the instance, but rather need to be set in the .Renviron file. For simplistic purposes, we can achieve this as in the example below, but see here for details on R startup configuration.

    Code Block
    languagebash
    # The following variable is assumed to be set for your environment
    export MOC_INSTANCE_URL=http://modelop:8090
    # Then make sure to pass it to the .Renviron file before running your instance
    env | grep MOC_INSTANCE_URL > /home/rstudio/.Renviron
    # Now you can start the RStudio server
    sudo rstudio-server start
  2. Even after started the RStudio you can modify (or set) the environment variable from within the R session to change the base ModelOp Center URL.

    Code Block
    languager
    Sys.setenv(MOC_INSTANCE_URL="http://modelop:8090")

ModelOp specific functions available within RStudio

RStudio provides an interface for the Addins that come with a package, they will be available in the “Addins” button in the IDE’s toolbar. Once installed, the RStudio interface is provided with the Addins section included in the “MODELOP” package with a set of operations that interact with ModelOp Center and will be expanded in the subsequent sections below.

RStudio supported documents

In order for ModelOp Addin to function properly, the user is required to create or open an R Markdown (or R Notebook) document and work the model in such file.

RStudio supports the use of R Markdown documents as an authoring framework for data science. They allow users to save and execute code as well as generate a high quality diverse output formats by mixing text document with code chunks. For more about R Markdown documents see here.

Info

The RStudio ModelOp Addin will assume you have an active (open and focused) R Markdown document in your workspace for the Addin to interact with.

ModelOp Addins work with an active R Markdown document by writing chunks into it or inspecting its chunks searching for associated ModelOp Center models. R Markdown chunks are fragments of source code delimited by lines with ```{r} and ``` embedded in an R Markdown document. Find out more about R Markdown chunks here.

Registering a new model
Status
titlenot supported

For the moment it is not possible to register a new model using the RStudio Addin. Please refer to the ModelOp alternatives to import a model into ModelOp Center

Opening an existing model

Include Page
Opening an existing model in RStudio
Opening an existing model in RStudio

Updating an existing model

Include Page
Updating an existing model using RStudio
Updating an existing model using RStudio

Submit model version

Include Page
Submit model version using RStudio
Submit model version using RStudio

Table of Contents

Table of Contents