2

For some reason I'd like to use R to plot a Python output in real time.

Let's imagine a simple case like this one:

# Python
import random
for i in xrange(100):
    output = random.gauss(1,1)

# R
output.vector = append(output.vector, output)
plot(output.vector)

How can I transfer the variable output from Python to R in real time? I think there are two questions (or more) hidden behind this one:

  1. What is the most efficient way to synchronize the two programs?
  2. What is the most efficient way to transfer a value from Python to R (write on a text file?)
Remi.b
  • 17,389
  • 28
  • 87
  • 168
  • 2
    Have you discovered [rpy](http://rpy.sourceforge.net/) yet? – joran Jan 10 '14 at 19:41
  • The answers to the question below are very relevant to what you want to do: http://stackoverflow.com/questions/5630441/how-do-rpy2-pyrserve-and-pyper-compare.. Personally working on Windows I have found that using PypeR was a lot easier than Rpy or Rpy2. – Lucas Fortini Jan 10 '14 at 19:57
  • http://rpy.sourceforge.net/ should be useful – JPC Jan 10 '14 at 20:08

0 Answers0