CaliperClass: R class representing GISDK objects

Description Details Public fields Methods Examples

Description

R class representing GISDK objects

R class representing GISDK objects

Details

This class simplifies working with GISDK objects over COM from R.

When created, an object of this class contains a COM pointer to a sister object in Caliper software. In addition to this reference, contained in the ref field, there are several other fields and methods to facilitate object manipulation. Finally, the $ operator has been overloaded for this class to make code easier to write.

Public fields

g_class_name

The class name of the underlying GISDK object (e.g. "NLM.Model").

ref

This is a COM pointer and represents the object created in a Caliper program.

info

This is a simple R list that can be used to see the fields and methods of the underlying GISDK object.

Methods

Public methods


Method new()

Create a new CaliperClass

Usage
CaliperClass$new(class_name, ...)
Arguments
class_name

string The name of the GISDK class to create.

...

Additional arguments to be supplied to GISDK object creation.

Returns

A new CaliperClass object.


Method apply_gisdk_method()

Runs a method of the associated GISDK object.

Usage
CaliperClass$apply_gisdk_method(method, ...)
Arguments
method

string The name of the method to apply.

...

Additional arguments supplied to the GISDK method.


Method get_gisdk_attribute()

Retrieve an attribute from the GISDK object.

Usage
CaliperClass$get_gisdk_attribute(attribute)
Arguments
attribute

string The name of the GISDK attribute to get.

Returns

The GISDK attribute value.


Method set_gisdk_attribute()

Set an attribute of the GISDK object.

Usage
CaliperClass$set_gisdk_attribute(attribute, value)
Arguments
attribute

string The name of the GISDK attribute to get.

value

The value to assign to the attribute.


Method clone()

The objects of this class are cloneable with this method.

Usage
CaliperClass$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# object creation (two options)
obj <- CreateObject("NLM.Model")
obj <- CaliperClass$new("NLM.Model")

# get info about the GISDK object fields and methods
obj$info

# set an attribute/field label of the GISDK object
# (Does not modify the R object in any way)
obj$Label <- "a logit model"

# run one of the GISDK object's methods: Clear()
# (Does not modify the R object in any way)
obj$Clear()

# object methods can be chained
obj$
 Clear()$
 Read()

## End(Not run)

dkyleward/caliperR documentation built on July 16, 2020, 1:54 a.m.