returnModel {CoCoRaw} | R Documentation |
Return the model or parts of it as a generating class.
returnModel(model = "current", type = "both", as.edges = FALSE, split.string = FALSE, split.generators = FALSE, data = NULL, object = .object.of.model(model, data = data, ...), ...)
model |
Numeric, model object, text string, or logical.
A numeric should give a valid model number in the object ,
see makeCurrent about the model list.
The argument can also be a CoCo model object, see
makeModel about creating model objects.
A text string can give the model as a generating class
(or generating classes in MIM-form for mixed models), see
enterModel for the notation of models.
The text strings "base" , "current" , or "last"
refers to the three models.
The default value "current" for the CURRENT model
can also be given as the logical FALSE.
|
type |
A character string, selecting
"gc" : generating class(es),
"cs" : causal structure,
"both" : both the generating class(es) and
the causal structure,
"discrete" : discrete part of mixed models,
"linear" : linear part of mixed models,
and "quadratic" : quadratic part of mixed models.
|
as.edges |
Logical, if as.edges is TRUE then the edges
of the model are returned. |
split.string |
Logical, if split.string is TRUE
then the generating classes are split into
character strings with the generators. |
split.generators |
Logical, if split.generators is TRUE
then the generating classes are split into lists,
each item in the list a vector of character string
with the vertices of a generator. |
data |
See exportCoCo . |
object |
See exportCoCo . |
... |
Additional arguments to generate the CoCo object
from the data argument. See propertyModel . |
A character string, a vector of character strings, a list of vectors of character strings, or a matrix of integers.
Currently only the generating class can be returned by as.edges
.
Jens Henrik Badsberg
Badsberg, J.H.: Xlisp+CoCo, Aalborg University, 1996.
library(CoCoCg); # Without "data" require ending the CoCo object: # returnModel("abxy,bcyz", type = "linear", data = "From.input", continuous = "xyz"); # endCoCo(); # With CoCo a object: data(Rats); CoCoObject <- makeCoCoCg(); enterDataFrame(Rats, object = CoCoObject); fullModel <- makeModel(enterModel("*", object = CoCoObject)); enterModel("[[b][a]] / [[by][bx][ay][ax]] / [[xy]]", object = CoCoObject); enterModel("[[a][b]] / [[ay][ax][bx]] / [[xy]]", object = CoCoObject); homogeneModel <- makeModel(enterModel("[[ab]] / [[aby][abx]] / [[x^][abxy][y^]]", object = CoCoObject)); # Show the model list: showModel("all", object = CoCoObject); returnModel(object = CoCoObject); returnModel(type="discrete", object = CoCoObject); returnModel(type="linear", object = CoCoObject); returnModel(type="quadratic", object = CoCoObject); returnModel(type="gc", object = CoCoObject); returnModel(type="cs", object = CoCoObject); returnModel(3, type="gc", object = CoCoObject); returnModel(3, type="discrete", object = CoCoObject); returnModel(3, type="linear", object = CoCoObject); returnModel(3, type="quadratic", object = CoCoObject); returnModel(3, object = CoCoObject, split.string = TRUE); str(returnModel(3, object = CoCoObject, split.generators = TRUE)); returnModel(3, object = CoCoObject, as.edges = TRUE); .fix.edges("xy") returnModel(3, object = CoCoObject, as.edges = TRUE); returnModel(3, object = CoCoObject, as.edges = TRUE, fix = "all"); returnModel("abx", type = "discrete", object = CoCoObject); returnModel("a,bx", type = "discrete", object = CoCoObject); endCoCo(object = CoCoObject);