Skip to content

object length

4 messages · linda.s, Uwe Ligges, PIKAL Petr +1 more

#
Why I got warning from the following code?
[1] 10  5  4  2  2  0 10  5  4  2  2
Warning message:
longer object length
        is not a multiple of shorter object length in: 2 * x + y
[1] 31 16 13  7  7 21 21 14  9  7 23
#
linda.s wrote:
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
#
Hi
On 20 Dec 2005 at 2:21, linda.s wrote:
Date sent:      	Tue, 20 Dec 2005 02:21:34 -0800
From:           	"linda.s" <samrobertsmith at gmail.com>
To:             	r-help at stat.math.ethz.ch
Subject:        	[R] object length
Because longer object length is not a multiple of shorter object 
length e.g.

x has length 5 and y has length 11 and they can be recycled during 
computation only fractionally. So the program computes the result but 
warns you about this. If you expected both vactors have same length 
there is time to look more closely to how they look like and how they 
were constructed.

HTH
Petr
Petr Pikal
petr.pikal at precheza.cz
#
linda.s wrote:
Because the y vector contains 11 elements and the x vector contains 5. 
The message is just to warn the user that the elements of the shorter 
vector will not be uniformly represented in the result.

Jim