0

I have several R scripts that take in data (likely from arguments passed to Rscript or a bat file), chug through a calculation and at the end output either a list or vector of values (generically floats and strings). How can I output only these values to stdout (or whatever is appropriate) to the calling C# process without resorting to writing and reading files as a middle man?

5
  • possible duplicate of Best Way to call external program in c# and parse output Commented Mar 18, 2014 at 21:45
  • Yup, that's the C# end of things, but there are R specific issues (like directing correctly to stdout and only outputting the necessary variables) that the linking question doesn't address. Commented Mar 18, 2014 at 21:53
  • How to print values to stdout in R would probably justify its own question (or a Google search). The title (and indeed body) of the question does not cover how to print from R. Commented Mar 18, 2014 at 21:55
  • Would you then be satisfied if I updated the title/body of this post to reflect that? Commented Mar 18, 2014 at 21:58
  • Done, see if you like that phrasing better? Commented Mar 18, 2014 at 21:59

1 Answer 1

0

There are several options available to pass data in-memory between R and .NET/Mono or over a network pipe, without file I/O in-between. I'll mention a couple I am partial to, being respectively a contributor to, and author of,

  • R.NET if the entry point is a program running on .NET or Mono, calling R. A new release is under development.
  • the rClr package if R is the main process. Mirrored on a GitHub repository. The latest official binary release is available, at the time of writing, at r2clr.codeplex.com.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.