getNumPythonConverters {RSPython}R Documentation

Query the currently registered object converters between R and Python.

Description

These functions allow the user to examine what C routines and R and Python functions are currently registered to implement the conversion between R and Python objects. These control how values in one system are converted to objects in the other system as they are transferred as arguments to functions in the foreign system and returned as results to the calling system. These functions give both the number and descriptions of each of the converters registered in either direction (i.e., from R to Python and vice-versa.) The descriptions are usually specified by the registrant when the converters are registered.

Usage

getNumPythonConverters(which=c(fromPython = F, toPython = T))
getPythonConverterDescriptions(which=c(fromPython = F, toPython = T))
removePythonConverter(id, fromPython)

Arguments

which the direction(s) of the conversion of interest, i.e. from Python to R and/or from R to Python
id an identifier for the converter. This can be either an integer giving the position of the converter or the description string obtained from getPythonConverterDescriptions. The index is 1-based, i.e. the first element is at position 1.
fromPython a logical value. If TRUE this indicates that we are removing the specified converter in the from python to R collection of converters.

Details

Converters are registered at the C level as pairs of C routines given by a matching routine that determines whether the converter is appropriate for the object to be converted and the converter routine itself which performs the translation from one system to the other. Additionally,

Value

getNumPythonConverters returns an integer vector giving the number of converters in the list for each of the specified directions. getPythonConverterDescriptions returns a list with an element for each of the directions specified. Each element in this list is a character vector containing the description string for each of the different (match, converter) pairs.
removePythonConverter returns an integer vector whose names are the descriptions of the elements that were removed. If an element was not found, an NA appears for that element.

Author(s)

Duncan Temple Lang

References

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

See Also

.Python .PythonNew .PythonMethod

Examples


  getNumPythonConverters()
  getPythonConverterDescriptions()
  getPythonConverterDescriptions(c(fromPython = TRUE))

[Package RSPython Index]