checkObject {cointReg} | R Documentation |
Variable check for single objects.
Description
Checking the variable and convert it for internal use, if necessary.
(Also used by the cointmonitoR
package.)
Usage
checkObject(obj, obj.name, ..., out = "return", .env)
Arguments
obj |
[ |
obj.name |
[ |
... |
[ |
out |
[ |
.env |
[ |
Details
Possible values of obj.name
to check:
"y"
,"x.stat"
:-
Of type
numeric
,matrix
ordata.frame
. Only the first row/column will be used.
Converted to object: column matrix "y.fm"
,"x.coint"
,"deter"
:-
Of type
numeric
,matrix
ordata.frame
.
Converted to object: column matrix "m"
:-
Of type
numeric(1)
, has to be greater than 0. "model"
:-
One of
c("FM", "D", "IM")
. "signif.level"
:-
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)
. "kernel"
:-
One of
c("ba", "bo", "da", "pa", "qs", "th", "tr")
. "bandwidth"
:-
One of
c("and", "nw")
. "selector"
:-
One or both
c(1, 2)
.
Value
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
Examples
x = matrix(1:20, nrow = 2)
x2 = checkObject(x, "x.coint")
x2
env = environment()
y = 1:10
checkObject(y, out = "assign", .env = env)
y
# example for the use of the ... argument:
det = rbind(1, 1:10)
x3 = sin(10:20)
det2 = checkObject(deter = det)
det2
(checkObject(deter = det, x.stat = x3))