Reputation: 4640
I am using subprocess
to run a Rscript. The script returns a R matrix. I am using subprocess.check_output
in Python and get a string. But is there a way to get directly the output matrix in Python?
Thanks
Upvotes: 1
Views: 99
Reputation: 1943
Exchanging objects between two languages is not an easy task.
The generic solution
This solution works for all languages:
Regarding R and python
There is an existing package to do that: rpy but it might be tricky to use, and some times errors are not quite explicit (because as I said, it is tricky to exchange object between two languages).
Upvotes: 1