[R] object length

From: linda.s <samrobertsmith_at_gmail.com>
Date: Tue 20 Dec 2005 - 21:21:34 EST


Why I got warning from the following code?
> assign("x", c(10, 5, 4, 2, 2))
> y <- c(x, 0, x)
> y

 [1] 10 5 4 2 2 0 10 5 4 2 2
> v <- 2*x + y + 1
Warning message:
longer object length

        is not a multiple of shorter object length in: 2 * x + y
> v

 [1] 31 16 13 7 7 21 21 14 9 7 23



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 Tue Dec 20 21:27:38 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:40 EST