clrNew: Create a new CLR object

Description Usage Arguments Value Examples

Description

Create a new CLR object

Usage

1
clrNew(typename, ...)

Arguments

typename

type name, possibly namespace and assembly qualified type name, e.g. 'My.Namespace.MyClass,MyAssemblyName'.

...

additional method arguments passed to the object constructor via the call to .External

Value

a CLR object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(rClr)
testClassName <- "Rclr.TestObject";
(testObj <- clrNew(testClassName))
# object with a constructor that has parameters
(testObj <- clrNew(testClassName, as.integer(123)))
clrLoadAssembly("System.Windows.Forms, Version=2.0.0.0, 
  Culture=neutral, PublicKeyToken=b77a5c561934e089")
f <- clrNew('System.Windows.Forms.Form')
clrSet(f, 'Text', "Hello from '.NET'")
clrCall(f, 'Show')

## End(Not run)

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