[R] object length

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Dec 20 12:01:39 CET 2005


linda.s wrote:
> 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

Read the Warning message and try to interpret it!!!!

If you still do not get the point:
   (length(x)*2+1) == length(y)

Uwe Ligges

> 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 at 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




More information about the R-help mailing list