foreignReference: Create a reference to an R object for use by a foreing...

Description Usage Arguments Value Author(s) References See Also Examples

Description

Create an object that is used to represent a local R object in a call to a foreign system (Java), optionally specifying a name by which it is to be stored locally and known externally and the name of one or more classes/interfaces that should be used to represent it. The last of these is interpreted by the remote system.

Usage

1
2
foreignReference(obj, id="", className=NULL, targetClasses=NULL,
                 register=TRUE)

Arguments

obj

The R value/object that is to be represented by this reference. When methods are invoked on the reference, they are applied to this object.

id

An identifier for the reference by which it can be known to foreign systems and internally. This is just a name.

className

Name of the (R) class of this object.

targetClasses

The name of a class or of interfaces which the foreign system should use when representing this object. This allows the reference to implement different e.g. Java interfaces so it can be used as an argument to different methods.

register

A logical value indicating whether the object should be “exported” by the foreign system (TRUE), or otherwise just a local object created to represent the R value without making it accessible remotely. If no value for id is supplied and the reference is registered, a counter used to generate unique references is incremented. (Is this true?)

Value

An object of class foreignReference.

Author(s)

Duncan Temple Lang, John Chambers

References

http://www.omegahat.org/RSJava

See Also

.Java .JavaConstructor

Examples

1
2
  data(mtcars)
  foreignReference(mtcars, targetClasses="DataFrameInt") 

SJava documentation built on Oct. 5, 2016, 4:17 a.m.