Learn R Programming

rDotNet (version 0.9.1)

.ccall: call a method on a .NET object

Description

This function calls a method on a previously created object.

Usage

.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

Run this code
# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab