Displaying 2 results from an estimated 2 matches for "tslm".
Did you mean:
tsl
2011 Nov 11
1
Formula variable help
I have an R script with the following applicable lines:
xshort <- window(s, start=st, end=ed)
. . .
xshort <- ts(xshort, frequency=1, start=1)
. . .
m1 <- m2 <- m3 <- m4 <- m5 <- m6 <- NULL
m1 <- tslm(xshort ~ trend)
I get an error:
Error in get(dataname) : object 'xshort' not found
When I do traceback() I get:
3: get(dataname)
2: tslm(xshort ~ trend) at #19
1: model.cross.validation(l[["MEN"]]$series)
Which points to the call to tslm above. Since I am not supply 'dat...
2010 Apr 22
1
Why does 'apply(.., 1, .., ..)' transpose result
I am sorry if this is documented in apply's dcumentation or completely
obvious, I could not find or work it out.
Given an matricies Q: 2x3, R:1x3 and S:1x2
apply(Q, 1, '-', R) is 3x2 and apply(Q, 2, '-', S) is 2x3
Why?
cheers
Worik
> Q
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 10 11 12
> R
[1] 1 4 7
> S
[1] 1 4
> apply(Q, 1, '-', R)
[,1]