SJava (version 0.98.0)

RtoJavaSig: Returns the Java type identifier for an R object

Description

This takes the given object and returns a string that can be used in the This is of most use for primitivesso that one doesn't have to remember the different Java characters representing its primitive types. This is currently not useful for non-primitive objects (e.g. lists) until javaSig is enhanced.

Usage

RtoJavaSig(obj)

Arguments

obj
Any R object, but the result is currently only meaningful if this is a primitive.

Value

A character vector of length 1 identifying the Java type (primitive or class) corresponding to the type of the input object.

Details

This examines the class and/or mode of the specified object and then calls javaSig to find the name of the Java class corresponding to the name of the given object's type.

References

http://www.omegahat.org, http://www.javasoft.com

See Also

javaSig

Examples

Run this code
 javaSig(1)
 javaSig(as.integer(10))
 javaSig("a string")
 javaSig(list(a=1))

Run the code above in your browser using DataCamp Workspace