Coder Social home page Coder Social logo

r-interop's Introduction

R Interop

.NET managed abstraction layer for communicating with R

Installation

Please note that there are breaking changes in terms of how RInterop works as well as command line arguments it takes in to start up.

Command-line arguments

--schema Path to schema binary file containing types to serialize and deserialize input data and output data sent to and received from the R package, respectively
--s Same as -schema

--rpackage Path to R package file containing statistical functions (optional if packages are already installed)
--r Same as --rpackage

--typemap Mapping from R function to input and output type schema.
--t Same as --typemap

Example

RInterop.exe --r C:\RPackages\MyStatsPackage_0.1.zip --s C:\RPackages\Schemas.dll --t C:\RPackages\TypeMap.json

Overview

R Interop starts a WCF service with named-pipe endpoints for inter process communication. Your application talks to R Interop through the named pipe. The following are the steps involved:

  1. Client application sends request to R Interop as an Input object.
  2. R Interop serializes the input object and sends the request to R package loaded in R.
  3. R function evaluates the input object and returns the output.
  4. R Interop deserializes the output and returns it to client application.

Note that both the client application and RInterop utilize the same Schemas library so that they can understand each other.

Named pipe endpoints

R Interop makes available 2 endpoints.

net.pipe://RInterop/

Metadata exchange (MEX) endpoint for generating a service reference within the client or caller application.

net.pipe://RInterop/R

Executes the R function provided in the Input object with members describing the parameters. Returns the result as the corresponding Output type. The types are as described in the dictionaries provided in TypeMap.json that map to the types in the Schemas assembly.

There are 3 Operations that can be performed on this API - Execute, InstallPackage, and RemovePackage. When a Service Reference is created, these operations will be available as methods on the Client object.

The format of TypeMap.json is as follows:

{
  "Mapping": [
    {
      "Function": "TTest",
      "InputType": "Schemas.TTest.Input",
      "OutputType": "Schemas.TTest.Output"
    },
    {
      "Function": "ChiSquareTest",
      "InputType": "Schemas.ChiSquareTest.Input",
      "OutputType": "Schemas.ChiSquareTest.Output"
    }
  ]
}

Windows events for developers

When RInterop starts up successfully, it will fire an event named Global\RInteropStarted. When RInterop is unable to start up successfully, it will fire an event named Global\RInteropStartupError and exit. The logs located in the %temp%\RInterop folder will help diagnose and/or resolve issues. Feel free to post questions on Github.

r-interop's People

Contributors

rajsell avatar rohit-joy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

r-interop's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.