Hi, guys:
According to the "Calling the R Statistical Package from IDL via Python", rpy2 with Anaconda2 successfully installed on my windows 64bit system. I can get the graphics windows with the following commands:
IDL> !null = Python.run("from rpy2.robjects.packages import importr")
% Loaded DLM: PYTHON27.
% Program caused arithmetic error: Floating underflow
% Program caused arithmetic error: Floating illegal operand
IDL> !null = Python.run("import rpy2.robjects.numpy2ri")
IDL> !null = Python.run("rpy2.robjects.numpy2ri.activate()")
IDL> importr = Python.importr
IDL> graphics = importr('graphics')
IDL> !null = graphics.plot(findgen(10), main="Eigen values")
But when I write those command into a procedure, like:
PRO test_rpy2
!null = Python.run("from rpy2.robjects.packages import importr")
!null = Python.run("import rpy2.robjects.numpy2ri")
!null = Python.run("rpy2.robjects.numpy2ri.activate()")
importr = Python.importr
graphics = importr('graphics')
!null = graphics.plot(findgen(10), main="Eigen values")
END
"test_rpy2" stopped at "graphics = importr('graphics')" and the error was given:
% Compiled module: TEST_RPY2.
% Python: Unable to index object of type: "function"
So why? thanks!
Dave
|