-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I have count data for 6 categories of a multivariate time series. I have tried the following two methods fts() and as.fts()
I have an xts object with the 6 columns of count data and dates
index(count.xts[1])
"2009-01-01"
dim(count.xts)
730 6
dts = format(seq(from=index(count.xts[1]),length.out=dim(count.xts)[1],by="days"),"%Y-%m-%d")
# countData is the original data frame with the dates and count data
count.fts1 = fts(index=as.Date(dts), data=as.matrix(countData))
count.fts2 = as.fts(data.frame(asofdate=dts,as.matrix(countData)))
When input either data object into ftsm() or plot() I get the following error:
Error in 1:ncol(y$y) : argument of length 0
I ran the following diagnostics:
class(count.fts2)
[1] "fts" "zoo"is.fts(count.fts2)
[1] FALSE
That doesn't really make any sense does it? It's a member of class fts but is NOT an fts object.
Just for good measure I did the following:
class(fts(index=as.Date(rownames(countData)),data=as.matrix(countData)))
[1] "fts" "zoo"is.fts(fts(index=as.Date(rownames(new.count)),data=as.matrix(new.count)))
[1] FALSE
What gives?