setPythonHandler {RSPython}R Documentation

Get or set the R to Python foreign reference handler.

Description

The R-Python reference manager/handler is responsible for caching and resolving R objects that are exported to Python as references to R objects. The manager accepts these R objects and stores them with a given unique name, and returns an object that identifies it. When the object is used in Python, the reference is passed back to R and resolved by this handler. This handler is implemented as a collection of basic R functions with different functions handling the storing and resolving of references, calling functions on that reference. Usually this is a closure that shares access to the pool of objects being exported. These two functions allow one to get the currently registered handler and also to set the handler.

Usage

setPythonHandler(handler)
getPythonHandler(handler)

Arguments

handler the handler to be registered as the active one.

Details

Currently, the form of the handler is quite restricted. It should be a list with the same length and functions in the same order as those in the default handler returned by referenceManager.

Value

Both functions return the reference handler that was registered before the function was called. In the case of the setPythonHandler, this is the value that is being replaced.

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/RSPython, http://www.python.org

See Also

referenceManager

Examples



[Package RSPython Index]