powered by
Y
Checks whether Y is either
numeric,
numeric
a ts object, or
ts
a zoo object.
zoo
If not, an error is returned. If it is one of the three the data is returned as a numeric.
timeSeriesValidator(Y)
Returns the time series as a matrix.
the time series to be validated.
Y <- timeSeriesValidator(sp500) Y <- timeSeriesValidator(wheatprices) Y <- timeSeriesValidator(rnorm(10)) if (FALSE) Y <- timeSeriesValidator("Not a valid input")
Run the code above in your browser using DataLab