foreignReference {RSPython}R Documentation

Creates a reference for an S object


This function creates a reference from an S object and optionally registers it with the foreign reference manager. This reference can then be used to identify the S object in a foreign system, passing it as either an argument in a function call to that foreign system or as the result of a call to an S function from that system. The reference can be given additional information such as a name by which to identify it, one or more target classes in the foreign system that it should masquerade as.


foreignReference(obj, id=NULL, className=NULL, targetClasses=NULL, register=T)


obj the S object which the new reference is to identify
id an optional name to use to identify this reference and value. This should be unique and if omitted will be generated by the reference manager so that it is unique. It can be specified here to provide a convenient way to refer to an object and also to simplify garbage collection.
className ?
targetClasses the names of any classes in the foreign system that this reference should ``implement'' when it is instantiated in this system. This is a way of controlling the conversion of the reference to an object in the foreign system.
register a logical value indicating whether the reference and object should be registered with the current foreign reference manager.


An object of class NamedRReference or AnonymousRReference depending on whether id is specified or not. The object contains the following fields

id the name for the reference
value the object or value (obj in the call) associated with this reference
targetClasses the value of targetClasses in the call
type the type of the object being referenced, computed by typeof
classes the class(es) of the object being referenced, computed by class


Duncan Temple Lang


See Also

referenceManager .Python .PythonNew .PythonMethod


[Package RSPython Index]