functions {XRPython} | R Documentation |
Function Versions of Methods for Python Interface evaluators.
Description
These functions allow application code to invoke evaluator methods for essentially all basic computations. Usually, they access the current Python evaluator, starting one if none exists. For details, see the documentation for the corresponding method, under PythonInterface.
Usage
pythonSend(object, evaluator = XR::getInterface(.PythonInterfaceClass))
pythonEval(expr, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonCommand(expr, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonCall(fun, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonGet(object, evaluator = XR::getInterface(.PythonInterfaceClass))
pythonSource(file, ..., evaluator = XR::getInterface(.PythonInterfaceClass))
pythonDefine(text, file, ...,
evaluator = XR::getInterface(.PythonInterfaceClass))
pythonSerialize(object, file, append = FALSE,
evaluator = XR::getInterface(.PythonInterfaceClass))
pythonUnserialize(file, all = FALSE,
evaluator = XR::getInterface(.PythonInterfaceClass))
pythonName(object)
pythonShell(..., evaluator = XR::getInterface(.PythonInterfaceClass))
Arguments
object |
For |
evaluator |
The evaluator object to use. By default, and usually, the current evaluator is used, and one is started if none has been. |
expr |
A string for a Python expression or command, with C-style fields ( |
... |
For the evaluation functions: Objects, either R objects to be converted or proxies for Python objects previously computed.
For other functions, specialized arguments for the corresponding method.
In particular, |
fun |
the string name of the function; a module name must be included in the string if the function has not been explicitly imported from that module. |
file |
A filename or an open connection, for reading or writing depending on the function |
text |
the definition as text (supply argument file= instead to read it from a file) |
append |
should the serializing text be appended to a file; otherwise the file will be truncated on opening. |
all |
should the unserialized object be a list of all serialized objects on the file? |
Functions
-
pythonSend
: sends theobject
to Python, converting it via methods forasServerObject
and returns a proxy for the converted object. -
pythonEval
: evaluates theexpr
string subsituting the arguments. -
pythonCommand
: evaluates theexpr
string subsituting the arguments; used for a command that is not an expression. -
pythonCall
: call the function in Python, with arguments given. -
pythonGet
: converts the proxy object that is its argument to an R object. -
pythonSource
: evaluate the file of Python source. -
pythonDefine
: define a Python function -
pythonSerialize
: serialize theobject
in Python, viapickle
-
pythonUnserialize
: unserialize the file in Python, viapickle
-
pythonName
: return the name by which this proxy object was assigned in Python -
pythonShell
: Start an interactive Python shell. See the chapter file in the documentation, section 14.3.