clrCall: Call a method on an object

Description Usage Arguments Value Examples

Description

Call a method on an object

Usage

1
clrCall(obj, methodName, ...)

Arguments

obj

an object

methodName

the name of a method of the object

...

additional method arguments passed to .External

Value

an object resulting from the call. May be a CLR object, or a native R object for common types. Can be NULL.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(rClr)
testClassName <- "Rclr.TestObject";
(testObj <- clrNew(testClassName))
clrCall(testObj, 'GetFieldIntegerOne')
## derived from unit test for matching the right method (function) to call.
f <- function(...){ paste( 'This called a method with arguments:', 
  paste(clrCallStatic('Rclr.TestMethodBinding', 'SomeStaticMethod', ...), collapse=', ')) }
f(1:3)
f(3)
f('a')
f('a', 3)
f(3, 'a')
f(list('a', 3))

## End(Not run)

jmp75/rClr documentation built on June 11, 2019, 6:45 p.m.