R with com the dark side of net
This presentation is the property of its rightful owner.
Sponsored Links
1 / 13

R with COM the dark side of .NET PowerPoint PPT Presentation


  • 109 Views
  • Uploaded on
  • Presentation posted in: General

Zurich. R with COM the dark side of .NET. [email protected] R with COM the dark side of .NET. Why I am talking about ‘nothing to do with R’ What are the issues with integrating R with other languages? The .NET paradigm Work done at codeplex A simple example done for free

Download Presentation

R with COM the dark side of .NET

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


R with com the dark side of net

Zurich

R with COMthe dark side of .NET

[email protected]


R with com the dark side of net1

R with COMthe dark side of .NET

  • Why I am talking about ‘nothing to do with R’

  • What are the issues with integrating R with other languages?

  • The .NET paradigm

  • Work done at codeplex

  • A simple example done for free

  • Graphing


Nothing to do with r

nothing to do with R

  • R solves difficult but particular problems

  • Enterprises have other issues

    • Integration with databases

    • R may be part of much larger developments

  • There is no concept of workflow


Integrating r

integrating R

  • R is late binding

    • Variable ‘types’ change at every step

    • Manages its own memory

  • Initial design as a pipe application, stdin, stdout (like sed etc.)


Integrating r1

integrating R

  • The big problem is exchanging complex objects in memory

    • Strings are never a problem!

    • Vectors, matrices, lists must be mapped to concepts inj the host language

  • COM solves by creating is own process with R

    • Expensive!

  • Java integration solves by utilizing only static types

    • Need to know a lot about the data before

  • .NET introduces “marshalling”

    • An buffer area where data can be read/written between managed and un-managed code


Net paradigm

.NET paradigm

  • (From Windows)

    • Event Handling

  • Common Run Time

    • Now towards its 4th incarnation

    • Good support for threading

    • security

  • Remoting

  • Diverse application languages

    • Adoption (and rejection) of new languages (e.g. J# and F#)


Events

Events

  • Message passing paradigm including call-backs

private void Application_Startup(object sender, StartupEventArgs e)

{

REngine.SetDllDirectory(@"C:\R\R-2.10.1\bin");

REngine.CreateInstance("RDotNet");

}

private void Application_Exit(object sender, ExitEventArgs e)

{

REngine engine = REngine.GetInstanceFromID("RDotNet");

if (engine != null)

{

engine.Close();

}

}


Xaml and code behind

XAML and ‘code-behind’


Rdotnet codeplex com

rdotnet.codeplex.com

  • Microsoft Project Hosting for Open Source Software

  • Implementation of R.h and Rinternals.h

  • Very impressive C# code

  • Currently only console device

internal interface INativeMethodsProxy

{

intRf_initEmbeddedR(intargc, string[] argv);

void Rf_endEmbeddedR(int fatal);

IntPtrRf_protect(IntPtrsexp);

void Rf_unprotect(int count);

void Rf_unprotect_ptr(IntPtrsexp);


Classes in r net bridges between r and net framework

Classes in R.NET bridges between R and .NET Framework.


A simple example done for free

A simple example done for free


Graphing

Graphing


Conclusions

Conclusions

  • .NET provides a modern wrapper for making the best use of R

  • .NET can be developed for free

    • A full environment does cost a little

  • An open license without the R(D)COM constraints

  • Just as easy to integrate with Excel


  • Login