ccall: call a method on a .NET object

Description Usage Arguments Examples

Description

This function calls a method on a previously created object.

Usage

1
.ccall(obj, methodname, ...)

Arguments

obj

An object previously created with .cnew()

methodname

name of method to be called on object

...

a sequence of arguments to the method. The arguments can either be fundamental types, vectors, matrices, or other objects. Fuzzy matching will be applied, allowing imperfectly matched argument types to be converted, as may be needed given R's more basic type system.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
series <- rnorm(100)

## create instance of an object, using fully qualified class name
obj <- .cnew ("com.stg.math.Model", 1.0, 3.5)

## call method F(3) on object
val <- .ccall (obj, "F", 3)

## call overload method F of 2 arguments F(3,4) on object
val <- .ccall (obj, "F", 3, 4)

## call method Estimate(series) on object
series <- rnorm(100)
val <- .ccall (obj, "Estimate", series)

## End(Not run)

rDotNet documentation built on May 2, 2019, 8:19 a.m.