[R] Behavior of apply() when used with start()

From: Fernando Saldanha <fsaldan1_at_gmail.com>
Date: Thu 14 Apr 2005 - 00:31:43 EST


Can someone explain why starts1 and starts2 are diffferent in the example below?

After running this program

a <- c(1:3)
b <- c(2:3)

tsa <- ts(a)
tsb <- ts(b, start = 2)
arr <- cbind(tsa, tsb)

starts1 <- cbind(start(tsa), start(tsb)) starts2 <- apply(arr, 2, start)

I get:

> starts1

     [,1] [,2]
[1,] 1 2
[2,] 1 1

> starts2

     tsa tsb
[1,] 1 1
[2,] 1 1

Thanks for the help.

FS



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Apr 14 00:43:52 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:07 EST