Can anyone tell me what's going on here?

x <- matrix(data=c(1,2,3,4,5),ncol=1)
x1 <- lag(x,k=1)
x
x1
x - x1

That's with x specified as a column vector, but the same thing happens when
it's a row vector.

x <- c(1,2,3,4,5)
x1 <- lag(x,k=1)
x
x1
x - x1

When the documentation says "Vector or matrix arguments x are coerced to
time series." What does that mean?

Thank you,
Mitch 

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to