knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(caliperR) dk <- connect()
The Caliper scripting language (GISDK) contains numerous objects which
facilitate the analysis of transport problems. This vignette explains how to
work with these objects from R using the caliperR package. If you are not
already familiar with the basics of this package, see
vignette("using-caliperR").
In TransCAD, the NLM.Model object facilitates the creation and application of
logistic regression models. To use this object from R, we create it like so:
object <- CreateObject("NLM.Model")
This creates both the GISDK object and an R object (R6 class) that points to it.
From here, the only difference between R and GISDK is syntax: R uses $ instead
of . to access object attributes and methods. The code below sets the Label
attribute of the NLM.Model GISDK object.
object$Label <- "A logit model" object$Label
Next, the Clear() method of the NLM.Model object is called, which removes
the value of all fields including Label.
object$Clear() object$Label
To see the complete list of available fields and methods for the GISDK object,
simply use object$info.
info <- object$info head(info$FieldNames) head(info$MethodNames)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.