shane shane - 1 year ago 67
R Question

arguments to python script from R

I have to pass some values to a python script and get some values back from it in R. I am presently using rPython library in R. I am able to get values from script using

. How can I send values to python script?

Anything other than rPython which can help me do this is also appreciated.

Answer Source

python.assign seems to be the function you need.

From the package documentation for RPython:

    Functions that assign and get Python variables from R.
    python.assign(, value, ...)

Arguments   a character string containing a valid python variable name
    value      an R object whose equivalent wants to be assigned to the variable in python
    ...        other arguments passed to the internal toJSON function cal
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download