checkObject {cointReg}R Documentation

Variable check for single objects.


Checking the variable and convert it for internal use, if necessary. (Also used by the cointmonitoR package.)


checkObject(obj,, ..., out = "return", .env)



Variable or value to check and convert.

Name of the object to check. If missing, the name of obj has to be one of the possible names (see details).


An alternative to the use of the obj and arguments is to directly give the name and the variable to be checked via name = variable arguments (see examples). In the case of more than one ... argument, checkVars will be called internally.


Whether to "return" or to "assign" the checked (and converted) object. Also possible: c("return", "assign").


Environment to which to assign the converted obj (usually the same on that contains obj, if it's a variable).
Required, if argument out contains "assign".


Possible values of to check:

"y", "x.stat":

Of type numeric, matrix or data.frame. Only the first row/column will be used.
Converted to object: column matrix

"", "x.coint", "deter":

Of type numeric, matrix or data.frame.
Converted to object: column matrix


Of type numeric(1), has to be greater than 0.


One of c("FM", "D", "IM").


Of type numeric(1), has to be in the interval [0.01, 0.1].

"trend", "return.stats", "return.input", "demeaning", "t.test":

Converted to object: logical(1).


One of c("ba", "bo", "da", "pa", "qs", "th", "tr").


One of c("and", "nw").


One or both c(1, 2).


The checked and converted argument is assigned to the given environment (.env) and/or returned (depending on the argument out).

See Also

Other check: checkDoptions, checkVars


x = matrix(1:20, nrow = 2)
x2 = checkObject(x, "x.coint")

env = environment()
y = 1:10
checkObject(y, out = "assign", .env = env)

# example for the use of the ... argument:
det = rbind(1, 1:10)
x3 = sin(10:20)
det2 = checkObject(deter = det)
(checkObject(deter = det, x.stat = x3))

[Package cointReg version 0.2.0 Index]